Solved

Streamline Excel Macro procedure

Posted on 2011-03-11
6
212 Views
Last Modified: 2012-05-11
Hi All,
I am trying to create a macro so when formated the data can be sent directly to an access dba. I have managed to get most of it done with trial and error but not working like I want it too. Maybe someone can show me how to make it more efficient.
I have a spreedsheet that is generated by a third party software in .csv format. I then manually copy the data from that spreedsheet into another spreedsheet with macro to format the data for export to an Access database. Would probaly just ask another question with this part.

So basically I copy data from the .csv sheet onto sheet1 of the other database. I select ctrl-G to run the macro to format. It fines matching records from the Employees sheet and sums totals.

Problems:

1. I can't get the date to format correctly.  it needs to be formatted as mm/dd/yyyy
2. I can't figure out how to get it to just use the line needed instead of entering a range then having to delete all the other rows. After the macro runs, I have to delete lines all the way down to row 400. Thats because I don't know how format the macro to only use the rows needed. HELP!!!!!!!

Any assistance would be greatly appreciated.

Thanks  
SecureMessagePerUser--5-.csv
SecureMessageEditor-test.xlsm
0
Comment
Question by:KLMServices
  • 3
  • 3
6 Comments
 
LVL 30

Expert Comment

by:SiddharthRout
ID: 35108978
Here is the updated file. I created a temp sheet2 so that you can copy the data from there directly instead of csv for testing purpose.

Regarding your 2 problems, they have been taken care of.

I am unsure what you want to do after Copying the Columns Columns("E:I") so I have entered an "Exit Sub" so that you can see the progress till there.

I have streamlined your code to quite an extent.

Let me know if you have any problems.

Sid
SecureMessageEditor.xlsm
0
 

Author Comment

by:KLMServices
ID: 35109675
Thanks Sid,

Much better than what I had. But when the macro is ran, it should only have 5 columns of data. Just like I had before.

date
queue
Agent
Extension
Message count

The queue column will needs to always populate "Web" in that field for each record. Your procedure generates the correct information, but just need the information to populate in column A thru E.

Reason for this is, I will have to copy and paste this data directly into access, hopefully I would be able to automate this process also.

Hopefully I was able to explain myself.

Thanks again for your help with this.
0
 
LVL 30

Expert Comment

by:SiddharthRout
ID: 35114038
The macro generates this In E-I (Total 5 Cols)

                        NumberOfMessages
06124061            Smith      8510993      15
06124061            Nelson      8518266      1
06124061            Storie      8519916      10
06124061            Story            1
06124061            Ross      8519995      2

How are they supposed to be incorporated in Col A-D (Total 4 Cols)?

Sid
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:KLMServices
ID: 35114521
If you run my original macro you will notice that it only leaves has the date, web, name, extension and calls in A - D. In the macro that you did, I am not sure what 06124061 represents.
0
 
LVL 30

Accepted Solution

by:
SiddharthRout earned 500 total points
ID: 35114741
Please test this for me.

Sid
SecureMessageEditor-test.xlsm
0
 

Author Closing Comment

by:KLMServices
ID: 35115757
This solution is perfect. You make it look so easy. Thanks for your help on this. Now I will tackle exporting formatted data to an Access dba
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Getting error in connectionstring with Excel. 30 30
Route Recommendation 18 31
VBScript Write Column Headers 3 34
Rather Simple Formatting Question 6 23
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question