This is a repost of my earlier question. Any help is greatly appreciated.
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.
_________________
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
_________________
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.
_________________
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
_________________