willow1985
Well-known Member
- Joined
- Jul 24, 2019
- Messages
- 931
- Office Version
- 365
- Platform
- Windows
Hello all,
I was hoping someone would be able to help me in modifying a VBA code
The below code checks if a certain range is blank or not and proceeds accordingly. The range is determined from where the cell is selected (which is why relative references is used) and if Columns B to K are blank in that particular row the macro will not proceed.
What I would like to do is add one more column which is Column S (aka Cells(Selection.Row 19)
How would I go about doing this?
Thank you to any who can help!
I was hoping someone would be able to help me in modifying a VBA code
The below code checks if a certain range is blank or not and proceeds accordingly. The range is determined from where the cell is selected (which is why relative references is used) and if Columns B to K are blank in that particular row the macro will not proceed.
What I would like to do is add one more column which is Column S (aka Cells(Selection.Row 19)
How would I go about doing this?
Thank you to any who can help!
VBA Code:
Dim msg As String, ans As Variant, lr As Long, sh As Worksheet, lo As ListObject
If Application.CountIf(Sheets("NCR Log").Range(Cells(Selection.Row, 1), Cells(Selection.Row, 11)), "") > 0 Then 'this line is what I require modified
MsgBox "Please Complete all manditory fields (Columns B to K & S)"
Range(Cells(Selection.Row, 17), Cells(Selection.Row, 17)).ClearContents
Exit Sub
End If
msg = "Your NCR File will be finalized," & vbCrLf & "" & vbCrLf & " Do you wish to continue?"
ans = MsgBox(msg, vbYesNo)
Select Case ans
Case vbYes