View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ryan Hess Ryan Hess is offline
external usenet poster
 
Posts: 15
Default Search value, if found transfer select data to specific locations.

I start the search on a sheet named "Search". I enter the ID number that I
want to look up in cell E4.

Trying to get a macro button to work. Can't figure out how to locate an ID
number on a sheet (named "Data") and if it is found, transfer data in the row
the ID number is located to another sheet (named "Final") using the lines
below.

Sheets("Final").Range("D14").Value = Sheets("Data").Range("B*").Value
Sheets("Final").Range("D15").Value = Sheets("Data").Range("C*").Value
Sheets("Final").Range("D13").Value = Sheets("Data").Range("E*").Value
Sheets("Final").Range("H18").Value = Sheets("Data").Range("G*").Value
Sheets("Final").Range("H19").Value = Sheets("Data").Range("H*").Value
Sheets("Final").Range("H20").Value = Sheets("Data").Range("I*").Value
Sheets("Final").Range("H21").Value = Sheets("Data").Range("J*").Value
Sheets("Final").Range("H22").Value = Sheets("Data").Range("K*").Value
Sheets("Final").Range("H23").Value = Sheets("Data").Range("L*").Value

* = the row in which the ID number you searched is located.


If the ID number is not found I would like it to pop up a MsgBox saying for
example "No record".

Any help would be greatly appreciated.

Thank you!