Two Workbooks-One Data..Comparing!

rnhutsko

Board Regular
Joined
Apr 22, 2005
Messages
87
Been awhile since I last visited. I would appreciate a helping hand. I have the following situation:


I keep a spreadsheet (mainsheet) that lists all the pertinent Data for my inventory. It is sorted by make, Model, and year of the car. Each car has a stock number that is unique.

Every day the accounting department updates a proprietary accounting system and therefore my costs change daily. The accounting system has a function that I can manually export to an excel spreadsheet some very basic data. What I want to do is to write a macro in my spreadsheet that compares the stock# data in the "mainsheet" to the stock# data in the manual sheet and, if it is a match cut and paste the cost data to the mainsheet.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
One other thing...

I have written a little bit, but I keep getting hung up on what I thinkl is a boolean deal. What i mean is that Excel has a built-in function exact(text1,text2) that returns true or false. I was trying to utlize this meathodolgy but don't know how. here is my concept:

Sub concept
Do until selction.value= ""
get first cell data in manual sheet
select mainsheet first cell
pastetest = false
Do until selection.value =""
If exact(manual sheet stock#, mainsheet stock#) = true then
copypaste data
pastetest = true
end if
if pastetest = false then
paste manualsheet data on last row
end if
Loop
move to next cell in manualsheet
Loop
end sub
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,243
Members
449,075
Latest member
staticfluids

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