Hi,
I have this code that error's when I run it.
The red line is the one that is highlighted when it error's.
I think it is because the sheet it works on is blank at the moment, so is there something I could add in to prevent this error for happening again?
Thanks
Dan
I have this code that error's when I run it.
VBA Code:
Dim RngC As Range
Set RngC = Range("C" & Rows.Count).End(xlUp)
[COLOR=rgb(226, 80, 65)]Columns("C").Find("CARTONS", After:=RngC, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, MatchCase:=False, SearchFormat:=False).Select[/COLOR]
UserForm1.CARTONSSSCC1.Text = RngC.Offset(-1, 2).Value
UserForm1.CARTONSSSCC2.Text = UserForm1.CARTONSSSCC1.Text
The red line is the one that is highlighted when it error's.
I think it is because the sheet it works on is blank at the moment, so is there something I could add in to prevent this error for happening again?
Thanks
Dan