Excel Data Base Link
Assume Item No is in cell A1 of the calculator sheet which is the active
sheet. The database workbook is named "Data.xls" on a sheet named Data with
Item numbers listed in columns A
Sub Button_click()
Dim rng as Range, rng1 as Range
set rng =Workbooks("Data").Worksheets("Data").Range("A1:A2 000")
if Range("A1").Value = "" then exit sub
set rng1 = rng.find(Range("A1")
if rng1 is nothing then
msgbox "Not Found"
exit sub
End if
' no copy the data
rng1.Resize(1,4).Copy Destination:=Range("A9")
rng1.offset(10,0).Resize(1,2).Copy Destination:=Range("J9")
' and so forth
End Sub
--
Regards,
Tom Ogilvy
"Trying Hard" wrote in message
...
I have a workbook with numbered data base items that I use along with
other
workbooks, which are calculators for this data base information. I
currently
go to the data base copy the whole row of information then go to the
calculator workbook and paste this information. This is tedious and has
the
potential for errors because in my calculator workbook I have protected
some
functions in certain cells staggered across the destination row, so I
would
like to create a macro that will respect the protected cells and enable to
data base information to transfer with the entry of the Item number only.
How can I enter, or paste, the item number that will automatically enter
the
remaining item numbers information from a different workbook (data base)?
--
Thank you,
Trying Hard
|