Solved

Streamline Excel Macro procedure

Posted on 2011-03-11
6
210 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:KLMServices
Comment Utility
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
Comment Utility
Please test this for me.

Sid
SecureMessageEditor-test.xlsm
0
 

Author Closing Comment

by:KLMServices
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now