Notices
ECU Flash

Any of you a genius at Excel Macros and Visual Basic??

Thread Tools
 
Search this Thread
 
Old Jun 14, 2010 | 03:50 PM
  #1  
Jack_of_Trades's Avatar
Thread Starter
Evolved Member
iTrader: (17)
 
Joined: Jun 2007
Posts: 3,523
Likes: 2
From: Opelika,AL
Any of you a genius at Excel Macros and Visual Basic??

You guys are always my best resource so I figured I would ask here. THis is for my Virtual Dyno Room Simulator.

Macro:
I want to set it up so the user just pushes a 'form' button that opens a window to choose which file they want to extract data from. Once the file is chosen, it then looks for the columns with the following words (LogEntrySeconds,Engine RPM,Timing, and Boost) and copy/pastes the entire column into my spreadsheet in a specific location. If any of you can help the community with this, i will forever be in your debt! Or at least until the end of the month,lol.

Last edited by Jack_of_Trades; Jun 14, 2010 at 04:06 PM.
Reply
Old Jun 14, 2010 | 03:58 PM
  #2  
l2r99gst's Avatar
Evolved Member
iTrader: (2)
 
Joined: Mar 2004
Posts: 3,499
Likes: 4
From: CA
While that would be a great idea, it may not be universal. For example, those may be the default names in EvoScan, but for anyone that has changes them or use anything besides EvoScan, it won't work.
Reply
Old Jun 14, 2010 | 04:04 PM
  #3  
Jack_of_Trades's Avatar
Thread Starter
Evolved Member
iTrader: (17)
 
Joined: Jun 2007
Posts: 3,523
Likes: 2
From: Opelika,AL
Originally Posted by l2r99gst
While that would be a great idea, it may not be universal. For example, those may be the default names in EvoScan, but for anyone that has changes them or use anything besides EvoScan, it won't work.
Way ahead of you...sorta. I will have a checkbox for AEM,Evoscan and DSMlink logs to start and depending on which box is checked will depict which column names it looks for. I will also add a 'Settings' page that allows the program to use the default lookups or they can choose to enter their own lookup descriptions.

I will probably have it filter out only the items logged while at WOT as well like bBarnhill did with his beta version.

Just trying to minimize the copy/pasting burden if possible.
Reply
Old Jun 14, 2010 | 04:06 PM
  #4  
RevMatcher's Avatar
Newbie
iTrader: (7)
 
Joined: Nov 2008
Posts: 70
Likes: 1
From: Columbus IN
I can hold my own in this arena. Can help you design this... which version of excel are you using?
Reply
Old Jun 14, 2010 | 04:07 PM
  #5  
Jack_of_Trades's Avatar
Thread Starter
Evolved Member
iTrader: (17)
 
Joined: Jun 2007
Posts: 3,523
Likes: 2
From: Opelika,AL
Originally Posted by RevMatcher
I can hold my own in this arena. Can help you design this... which version of excel are you using?
Good old Fashioned 2003. Whoever helps me get this portion working flawlessly will most definitely get a mention in the release.
Reply
Old Jun 14, 2010 | 05:15 PM
  #6  
eXtreme-Speed's Avatar
Evolving Member
iTrader: (7)
 
Joined: Jul 2009
Posts: 334
Likes: 2
From: South, NJ
pm sent
Reply
Old Jun 15, 2010 | 07:40 AM
  #7  
RevMatcher's Avatar
Newbie
iTrader: (7)
 
Joined: Nov 2008
Posts: 70
Likes: 1
From: Columbus IN
Okay no problemo. I've done a fair amount of work using 03. Send me an email or a PM of what you have in mind!
Reply
Old Jun 15, 2010 | 11:51 AM
  #8  
Jack_of_Trades's Avatar
Thread Starter
Evolved Member
iTrader: (17)
 
Joined: Jun 2007
Posts: 3,523
Likes: 2
From: Opelika,AL
I will shoot you a pm when I get home from work.
Reply
Old Jun 15, 2010 | 10:49 PM
  #9  
mrfred's Avatar
EvoM Guru
iTrader: (50)
 
Joined: Mar 2006
Posts: 9,675
Likes: 132
From: Tri-Cities, WA // Portland, OR
Just saw this. I wrote a VBA macro (that I use every day) that does exactly what you want. If you haven't already got a solution, let me know.
Reply
Old Jun 17, 2010 | 03:16 PM
  #10  
Jack_of_Trades's Avatar
Thread Starter
Evolved Member
iTrader: (17)
 
Joined: Jun 2007
Posts: 3,523
Likes: 2
From: Opelika,AL
SO here is a hitlist of what I need to happen basically (forgive my lack of terminology with VB code):

When I click the 'Select BASE PULL Datalog File' button, the attached macro must do the following:

An 'Open File' Dialog Box appears (to choose which .csv datalog file to extract data from)

Before dumping new data into the specified locations in VDR, I want it to 'clear/delete' the old data first to eliminate any data remnants from the old datalog data.

Once selected, it looks for the column with LogEntrySeconds in it.

It then copies that entire column to a specified column in VDR.




After that is built, I just need to make it to the same thing for:

Engine RPM
AFR
Boost
Timing Advance





That's it really.

What I need to do is make the column names the macro searches for in the worksheet (i.e; anything bold in this post) to be referenced from a cell location in VDR. That way I can set it up so the user can modify the column names that the macro looks up (ie; MyWidebandSignal,1-Byte RPM Mod,etc...).

From my understanding, this can be done without the actual datalog file (workbook) ever being opened in Excel.

Last edited by Jack_of_Trades; Jun 17, 2010 at 03:27 PM.
Reply
Old Jun 17, 2010 | 04:06 PM
  #11  
mrfred's Avatar
EvoM Guru
iTrader: (50)
 
Joined: Mar 2006
Posts: 9,675
Likes: 132
From: Tri-Cities, WA // Portland, OR
VBA has to open the datalog for Excel to be able to read it. It then has to be closed afterwards. If screen updating is disabled (via VBA command is in the macro I sent to you), then the end user will never see any of this.
Reply
Old Jun 17, 2010 | 04:34 PM
  #12  
Jack_of_Trades's Avatar
Thread Starter
Evolved Member
iTrader: (17)
 
Joined: Jun 2007
Posts: 3,523
Likes: 2
From: Opelika,AL
MrFred, your macro was insane for me to try and figure out, plus it didnt work on a PC at all




This is a good starting point for guys more knowledgeable in this language than me. There is a link on this page that I got to work but IDK how to manipulate it for my specific needs.

http://www.ozgrid.com/forum/showthread.php?t=67714



Here is another:

http://www.ozgrid.com/forum/showthread.php?t=17158








.

Last edited by Jack_of_Trades; Jun 17, 2010 at 04:38 PM.
Reply
Old Jun 17, 2010 | 10:21 PM
  #13  
mrfred's Avatar
EvoM Guru
iTrader: (50)
 
Joined: Mar 2006
Posts: 9,675
Likes: 132
From: Tri-Cities, WA // Portland, OR
Too bad it didn't work at all. Are you still jonesing for some code to open a log file, parse the log file, and then close the log file? If yes, I will see what I can do this weekend to make the code work on a PC.
Reply
Old Jun 17, 2010 | 10:24 PM
  #14  
Jack_of_Trades's Avatar
Thread Starter
Evolved Member
iTrader: (17)
 
Joined: Jun 2007
Posts: 3,523
Likes: 2
From: Opelika,AL
eXtreme-Speed is supposedly gonna have some Macro code tossed together for me tomorrow. If he hits a snag, maybe I can have you guys start posting the code in this thread so all of you brainiac's can get this **** working for me lol. Next will be an .exe version of VDR if I can wrap my head around whats involved. For free....people can live with the Excel requirement at this time lol.

Last edited by Jack_of_Trades; Jun 17, 2010 at 10:26 PM.
Reply
Old Jun 22, 2010 | 06:58 AM
  #15  
Acree's Avatar
Evolved Member
15 Year Member
Photogenic
Photoriffic
Shutterbug
iTrader: (8)
 
Joined: Nov 2006
Posts: 787
Likes: 1
From: Dallas
I do extensive Excel programming at work and can write this in about 20 minutes.

Can you send me your email address so I can send you the file?

-Acree
Reply



All times are GMT -7. The time now is 12:56 AM.