[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Streamline Excel Macro procedure

Posted on 2011-03-11
6
Medium Priority
?
221 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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 2000 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

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.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
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…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

649 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