Update value of variable from one sheet to paste into another shee
Sub Findit()
Dim sh1 As Worksheet
Dim sh2 As Worksheet
Dim s As String, rng As Range
Set sh1 = Activesheet
Set sh2 = Worksheets("Standards")
s = sh1.Range("A1")
Set rng = sh2.Cells.Find(What:=s, _
After:=sh2.Range("IV65536"), _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rng Is Nothing Then
rng.Offset(0, 1) = s
Else
msgbox s & " wasn't found on Standard"
End If
End Sub
--
Regards,
Tom Ogilvy
"tibbs" wrote:
Could somebody please tell me how to select a specific cell and store the
text string of the cell into a string variable.
I then want to seach for the string on another sheet and paste into the cell
on the RH side of the cell that was searched for.
e.g
Dim i As String
ActiveSheet.Range("A1").Select
i = ActiveCell.FormulaR1C1
' search for i on another sheet.
Sheets("Standards").Select
Cells.Find (i)
ActiveCell.Offset(0, 1).Select
ActiveCell.FormulaR1C1=i
Is this correct ?
I'm pretty new at this and have had no training.
Thanks for any help you can provide.
|