View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Paul Paul is offline
external usenet poster
 
Posts: 661
Default find value in one sheet use this as the row to copy the value



Dear Don I am not doing this once but several times, with 30 columns.

I have this code but it falls down when there is no match

Public Sub test()
Dim cfind As Range
Dim x As Range
Dim cell As Range
Dim myrange As Range
Worksheets("printing").Activate
Set myrange = Range(Range("a3"), Cells(Rows.Count, 1).End(xlUp))
For Each cell In myrange
Worksheets("planning").Activate
With Range("e3:e61")
Set cfind = .Cells.Find(what:=cell.Value, lookat:=xlWhole)
Set x = cfind.End(xlToLeft)
End With
Worksheets("printing").Activate
cell.Offset(0, 3) = x
Next cell
End Sub