R
Rimmie
The following works as expected:
ActiveCell.Select
ActiveCell.FormulaR1C1 = "km-KH: HB for TP 1 Build"
Key = Left(ActiveCell, 18)
Sheets("All").Select
'If Key = "Km-KH: HB for TP 1" Then
Cells.Find(What:="km-KH: HO of TP 1", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
'End If
ActiveCell.Offset(0, -1).Range("A1").Select
Selection.Copy
Sheets("Test").Select
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(0, -1).Range("A1").Select
If I don't comment out the If and End If statments, it fails. Note the
correct value gets assigned to the variable Key. What am I doing wrong? Any
help for this novice would be greatly appreciated.
ActiveCell.Select
ActiveCell.FormulaR1C1 = "km-KH: HB for TP 1 Build"
Key = Left(ActiveCell, 18)
Sheets("All").Select
'If Key = "Km-KH: HB for TP 1" Then
Cells.Find(What:="km-KH: HO of TP 1", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
'End If
ActiveCell.Offset(0, -1).Range("A1").Select
Selection.Copy
Sheets("Test").Select
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(0, -1).Range("A1").Select
If I don't comment out the If and End If statments, it fails. Note the
correct value gets assigned to the variable Key. What am I doing wrong? Any
help for this novice would be greatly appreciated.