Solved

Streamline Excel Macro procedure

Posted on 2011-03-11
6
215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
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…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

688 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