Hello all - I would like to click on a cell in sheet(2) which activates a macro.
The macro would take the value from the selected cell in sheet(2) search for it in sheet (1) then cop/paste the found cell and its adjacent cells back to sheet(2)
I am having trouble even getting the find toe work. Here is the latest of my tries:
Sub LookUp()
Dim pCDCR As Long
Dim pr As Integer
Dim pFind As Range
Set pCDCR = Range(ActiveCell).xlValue
Set SOMs = Sheets(1)
Set pFind = Find(What:=pCDCR, After:=SOMs, LookIn:=xlValues, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
With Sheets(1)
Range(pFind.Row, 1).Copy
End With
With ActiveSheet
Range(ActiveCell.Row, 1).PasteSpecial
End With
End Sub
I appreciate any help - Jim A
The macro would take the value from the selected cell in sheet(2) search for it in sheet (1) then cop/paste the found cell and its adjacent cells back to sheet(2)
I am having trouble even getting the find toe work. Here is the latest of my tries:
Sub LookUp()
Dim pCDCR As Long
Dim pr As Integer
Dim pFind As Range
Set pCDCR = Range(ActiveCell).xlValue
Set SOMs = Sheets(1)
Set pFind = Find(What:=pCDCR, After:=SOMs, LookIn:=xlValues, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
With Sheets(1)
Range(pFind.Row, 1).Copy
End With
With ActiveSheet
Range(ActiveCell.Row, 1).PasteSpecial
End With
End Sub
I appreciate any help - Jim A