PDA

View Full Version : [SOLVED:] notification by vba



KAJAL1234
04-17-2020, 08:10 AM
vba is placed in a seperate file macro.xlsm
i have a file 1.csv
all files are located in a different path
In 1.csv we have to check the column E, if column E has a blank cell then a msgbox that it is an error & if no then do nothing
Plz help me in solving these problem by vba

paulked
04-18-2020, 03:25 AM
This should get you started



Sub test()
Dim rng As Range, cell As Range, wb As Workbook
On Error GoTo Oops
Set wb = Workbooks("1.csv")
wb.Activate
Set rng = Range("E1:E" & Sheets(1).UsedRange.Rows.Count)
rng.Select
For Each cell In rng
If cell = "" Then MsgBox "Cell " & cell.Address & " is empty.": Exit Sub
Next
ThisWorkbook.Activate
Exit Sub
Oops:
If wb Is Nothing Then MsgBox "Workbook 1.csv is not open!": Exit Sub
MsgBox "Unknown Error."
End Sub

KAJAL1234
04-21-2020, 11:57 AM
Thnx Alot Paulked Sir For ur Great Support
Probelm Solved

paulked
04-21-2020, 12:04 PM
:thumb

Please mark the thread 'Solved' (thread tools on tool bar).

KAJAL1234
04-21-2020, 12:37 PM
Sure Paulked Sir & Thnx for the info Sir