Sub test()
Dim cnt As Long
iF cnt = WorksheetFunction.CountBlank(Range("A1", Range("A" & Rows.Count).End(xlUp))) > O THEN
MsgBox "Location is blank for " & vbCrLf & cnt & " devices.", vbExclamation, "Action Required"
Range("A1:B" & LRow).AutoFilter Field:=1, Criteria1:="="
End If
'Insert Column to the left of Column A
Columns("A:A").Insert Shift:=xlToRight, _
CopyOrigin:=xlFormatFromLeftOrAbove 'or xlFormatFromRightOrBelow
Range("A1") = "CV_Location"
End Sub
----------------------------
| Column A | Column B |
--------------------------- |
| CV | TCMAD06 |
| CV1 | PC7OPSL31 |
| | PC7MESS240 |
| CV3 | PC7MEOS13 |
----------------------------
Message box shows correctly "Location is blank for 1 device(s)" (Cell A3 is empty)
Now, I would like to a create a formula which autofilter blank cell and then as soon as empty cells are filled up with correct informations , it should by pass the msgbox to carry on the rest of my script but I can't seem to make work with formula
Bookmarks