G
Guest
Guest
Hey, I`ve got a little problem, it`s not that hard but I want to put my finger on it.
This is a piece of my macro:
Sub workbook_beforeclose(cancel As Boolean)
Dim lc As Long, scan As Boolean
'scanning for empty cells in row 96
scan = True
For lc = 1 To 21
If Len(Cells(96, lc)) = 0 Then
scan = False
Exit For
End If
Next
If scan = False Then
MsgBox "value in colomn " & CStr(lc) & " is missing. Sheet will not be closed" _
, vbCritical, "uncomplete!"
cancel = True
Exit Sub
End If
If scan = True Then
scanpast
Else
End If
End Sub
As you can see, what is does is scan for empty cells in row 96. If it all cells a filled it will continue to the next routine (which is not shown here) if one of the cell in 96 is empty, a message will appear telling you which cell exactly is empty.
Now: what I want to do is format the variable LC so that the message not be:
"value in colomn 3 is missing. Sheet will not be closed"
but:
"value for Temperature is missing. Sheet will not be closed"
Can anyone help me with this!?
Thanks a lot!
This is a piece of my macro:
Sub workbook_beforeclose(cancel As Boolean)
Dim lc As Long, scan As Boolean
'scanning for empty cells in row 96
scan = True
For lc = 1 To 21
If Len(Cells(96, lc)) = 0 Then
scan = False
Exit For
End If
Next
If scan = False Then
MsgBox "value in colomn " & CStr(lc) & " is missing. Sheet will not be closed" _
, vbCritical, "uncomplete!"
cancel = True
Exit Sub
End If
If scan = True Then
scanpast
Else
End If
End Sub
As you can see, what is does is scan for empty cells in row 96. If it all cells a filled it will continue to the next routine (which is not shown here) if one of the cell in 96 is empty, a message will appear telling you which cell exactly is empty.
Now: what I want to do is format the variable LC so that the message not be:
"value in colomn 3 is missing. Sheet will not be closed"
but:
"value for Temperature is missing. Sheet will not be closed"
Can anyone help me with this!?
Thanks a lot!