Building a macro and dataobject error

Designtpi

New Member
Joined
Jul 10, 2007
Messages
11
Hello all
I have a question on a task that has been assigned to me at work. First off my experience with Visual Basic is limited. I can record macros and understand the programing of the macro once it's recorded. BUT when it comes to writing my own code things get a little out there. Anyway since i am the most familiar with programing (I can whip up a mean Autolisp routine :cool: ) i was give the task of making a macro for a spreadsheet that we have. I started to work my way through with the help on visual basic and the wall that i came across was that what i call a variable in lisp would be something like a dataobject in Visual. But when i try the run the code in the module the line "dim x as dataobject" returns an error. (there is no dataobject in the dropdown box that pops up when you are typing. Do you need to load this function?) I surrendered :cry: .The sheet consists of two sheet (the first page is the summery page w/ 30 or so rows with each row consisting of the vehicle #, 1 blank cell, one drop down list with weekly dates on it, then 2 cells that have the mileage of the vehicle and the date of the last maintenance on the rig. The Macro that im trying to build would first cycle through the column of blank cells checking to see if there is information in the cell. If there is information in the cell it would copy the information from the cell read the date that is entered in the drop down box search the second sheet for that date and enter the information in the correct cell. If someone would be able to take a look at it and give some pointers i would appreciate it. (also if someone would like to look at the actual sheets i can post them.)
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Welcome to the Board!

if someone would like to look at the actual sheets i can post them.)

Please, indicating what you have and what you want as a result. (See the link beneath my sig for how to post).

Smitty

Note for future posts: to try to break up your post so that it's readable. As it is it's really hard to read, let alone know what you want.
 
Upvote 0
Alright I have been given the task of writing a macro to ease the use of entering the mileage on our vehicles. I am proficient at LISP based programing but haven't had to deal much with Visual. If some one could give me some pointers/help on where to start i would appreciate it. Thanks,

The macro would run in this order:
1. On the Summary Data Sheet it would search down B column to see if there is any information in any of the cells in that column.
2. If it does come across a cell with information in it, it would store that information, along with the date that is in the adjacent cell.
3. It would search for the date in row 2 on the Detailed Data Sheet and when it found the date it would enter the copied information from column B of the Summary Data Sheet in the corresponding cell for the vehicle #. (The row #'s for each Vehicle # on both sheets are the same).
4. The search would continue until all cells in B column on the Summary Data Sheet that have a Vehicle # in the cell adjacent to them have been searched.

Here's Summary Sheet:
Copy of Odometer Tracking.xls
ABCDE
1InsertColumnCurrentReading
2Veh#ReadingDateReadingDate
3312080495/28/07
4411904005/14/071903725/7/07
5421317034/23/07
6432875976/4/07
7451889564/23/07
8462747746/11/07
9471897034/30/07
Summery Data


Here's the Detailed Data Sheet:
Copy of Odometer Tracking.xls
ABCDEFGHIJKLMNOP
1Date
2Veh#3/5/20073/12/20073/19/20073/26/20074/2/20074/9/20074/16/20074/23/20074/30/20075/7/20075/14/20075/21/20075/28/20076/4/20076/11/2007
331204121204642205332205986206713207297208049
441160405160406DumpTrk160462190372
5421312901313271313813140613141313604131703
643282307282482282592284231BrokeDown285059273639287139287597
745146319146319146344188956147581
846270022270042270721271385271820272096272580274774
947187771187820187894188226189703
Detailed Data
 
Upvote 0

Forum statistics

Threads
1,215,086
Messages
6,123,031
Members
449,092
Latest member
ikke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top