If any of these are BLANK then it should return the respective message.
The below is always returning "ALL GOOD" even when the cells are blank.
Any help is much appreciated.
Code: Select all
Sub checkforblanks
sheet = ThisComponent.CurrentController.ActiveSheet
TimeFrom = sheet.getCellRangeByName("B1").value
TimeTo = sheet.getCellRangeByName("B2").value
AttName = sheet.getCellRangeByName("B3").value
If Timefrom = "" then
Msgbox "Update Time From"
else
If Timeto = "" then
Msgbox "Update Time To"
else
If AttName = "" then
Msgbox "Update Attendant Name"
else msgbox "All Good"
Endif
Endif
Endif
End Sub