Advertisement

09.18.2008 at 02:55PM PDT, ID: 23744138
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.2

Access VBA Code to Open Excel, Clean-up columns, erasing empty rows and closing...

Asked by MasterandCommander in Access Coding/Macros, Microsoft Excel Spreadsheet Software, Microsoft Visual Basic.Net

Tags:

I have attached a file (Excel).  This is a sample file of an regular download from SAP.  I run that Job on a daily base and save the results as an .xls file, but the Data is almost like "throwing dirt at the wall", which means: I have lots of columns with junk information and also some random columns that are empty and rows as well.

In the good news department> I have consistently the same Headers that I need to "rescue" and import into a new and neat table in Access (to further analyze).  In our sample this would be Headername1 and Headername5.  Everything else must go, before it gets imported into Access.  What follows are the steps that I need in VBA Code:

1. Look for Folder C:\Cleanupfolder\Cleanup.xls

2. Have a Dialog Box pop up> Which Headernames do you need?

3. Now go Row by Row (it is most of the time the 8th row, sometimes more seldomly it is higher up, like the 6th row) and look
for the Headername I feed into the Dialog box.  Take decision> THIS is THE column that will stay.  Next.  Where is the second (or third?)
Headername feed into Dialogbox.  Now, hold on to those COLUMN NAMES, because...

4....Every column WILL be deleted, with exception of the ones from step 3.  Everything shifts to the furthermost left.  

5.  Mostlikely there are a few rows ABOVE my headernames.  They have to go too.  Delete ehm.

6.  Save this file as it is.  Clean.  Now import that into Access (creating the table?  Or should i have a tempTable waiting for the info?)

Thanks guys.  I am calling out.  I really tried hard to accomplish this, learned a lot in the process, but my code parts are the work of a madman going crazy (I still have lot to go in terms of Visual Basic Coding... :-(

Thanks a lot.  500 Dingos to the guy who hits the Pinata ;-)


Start Free Trial
Attachments:
 
Sample File with Downloaded Data
 
[+][-]09.18.2008 at 08:14PM PDT, ID: 22517601

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Coding/Macros, Microsoft Excel Spreadsheet Software, Microsoft Visual Basic.Net
Tags: Access VBA
Sign Up Now!
Solution Provided By: StellanRosengren
Participating Experts: 1
Solution Grade: A
 
 
[+][-]09.19.2008 at 02:59AM PDT, ID: 22519326

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.19.2008 at 07:02AM PDT, ID: 22521135

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42 / EE_QW_2_20070628