![]() |
![]() |
|
|||||||
| 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
Location: n/a
Posts: 6
|
I would like to create a macro which checks at the beginning if a certain cell has a value. if the cell has a value the macro carries on running as normal, if the cell is blank, a message comes up to tell the user that 'the data isn't verified....' or something like that. help! how do i do this?
thanx to anyone who can help me. chiao, dj_dafad p.s. is it something along the lines of this: Dim wrong If Range("d20") = 0 Then wrong = MsgBox("you have not verified that all of the data entered is correct", vbExclamation,"verify") GoTo FINISH End If |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Kobe, Japan
Posts: 1,420
|
Hi. How about use "IsEmpty"?
If isempty(range("D20") then msgbox "you have not....." end if |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Perth Australia
Posts: 1,567
|
Hi there
Try changing it a bit to something like this (insert the macro code you want to run if D20 is not 0 where is says "rest of your macro" (without the quotes) If Range("d20") = 0 Then MsgBox "you have not verified that all of the data entered is correct", vbExclamation, "verify" Exit Sub Else "rest of your macro" End If End Sub regards Derel |
|
|
|
|
|
#4 |
|
New Member
Join Date: Apr 2002
Posts: 1
|
Hello, friend.
Thank you for your amazing question. I think you are on the right track to solving your problem with the IF function. I am not familiar with the deep dark realms of the evil microsoft's Visual Basic. If you wish to proceed and learn this foreign tounge, do so at your own risk. But be warned, demons lurk behind them AND THE MIGHTY VULCANS SHALL NOT SAVE YOU. In the words of Captain Kurk of the starship enterprise, peace be with you, friend. |
|
|
|
|
|
#5 |
|
New Member
Join Date: Mar 2002
Location: n/a
Posts: 6
|
hey, thanks for the help, it works.
M-Disley, I don't know what your on about, mayby you should lay off the star wars. thaks again dj_dafad |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|