Hello All,
Please take a look at code in below and help me how to solve the problem with errormsg:
Regards,
tt3
Please take a look at code in below and help me how to solve the problem with errormsg:
Code:
strName = InputBox(Prompt:="Please enter model here", _
Title:="Model", Default:="xxxxxx")
If strName = "xxxxxx" Or _
strName = vbNullString Then
Sheets("Sheet1").Visible = False
Exit Sub
Else
With Sheets("Sheet1").Select
On Error GoTo errormsg
Cells.Find(What:=strName, After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.EntireColumn.Select
Selection.Copy Destination:=Sheets("Result").Range("C1")
End With
End If
errormsg:
MsgBox "Error"
tt3