![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 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 |
|
|
|
|
|
#2 |
|
New Member
Join Date: Mar 2002
Posts: 34
|
...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 |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Perth Australia
Posts: 1,567
|
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 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|