Check for blank entries

matthewh

New Member
Joined
Mar 13, 2002
Messages
34
I have a form that's been set up in Excel, and need to check some of the fields have been filled in prior to printing or saving, and if they are empty then n error message is generated. The numeric fields are fine and work ok, but the text fields don't want to play. I'm using

If Selection.FormulaR1C1 = "" then msgbox("...") etc

I'm sure there's a proper way but can't see it. Please can anyone help?

Thanks
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
...can I use IsNull?

Like if IsNull(xxxx) then msgbox("...")

IF so what should xxxx be? SOme of the cells are joined, by the way.

Thanks again.

Matt
 
Upvote 0
Hi there

Would this code help - there needs to be about 10 spaces between the second set of quotes

For Each cell In Selection
If cell.Value = "" Or cell.Value< " (put 10 spaces between quotes) " Then
MsgBox "blank fields " & cell.Address
End If
Next
End Sub

Regards
Derek

PS for relative reference in your message use: MsgBox "blank fields " & cell.Address(relative, relative)
This message was edited by Derek on 2002-05-09 01:28
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top