jackyoung2012
Board Regular
- Joined
- May 22, 2012
- Messages
- 63
Hi All,
I'm trying to write a procedure that checks to see that, when a cells value is changed, if the cell nex tto it is empty, some extra code runs. I have made a start but keep getting an error message:
I keep getting the error "method range of object '_worksheet failed. Any ideas? I am triggering this function by passing through a string with the worksheet name and a range object.
I'm trying to write a procedure that checks to see that, when a cells value is changed, if the cell nex tto it is empty, some extra code runs. I have made a start but keep getting an error message:
Code:
Sub validateCompleteOrder(ByVal sheetname As String, ByVal address As Range)
Dim ws As Worksheet
Dim checkrange As Range
Set ws = Worksheets(sheetname)
Set checkrange = address
If IsEmpty(ws.Range(address).Offset(0, 1)) Then
MsgBox ("worked")
End If
I keep getting the error "method range of object '_worksheet failed. Any ideas? I am triggering this function by passing through a string with the worksheet name and a range object.