If cell blank give error on update

dan17602

New Member
Joined
Mar 20, 2011
Messages
9
Hi All,

I have a macro that updates a worksheet based upon the value in the cell, what Im looking for is if the cell is blank to return an error saying please select.

Is this possible?

Any help would be great,

Thanks, Dan
 

Some videos you may like

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Mike Blackman

Well-known Member
Joined
Jun 8, 2007
Messages
2,494
Hi,

Do you mean like this?

Code:
    If Len(Range("A1")) = 0 Then
        MsgBox Prompt:="Please Ensure A1 has a value!", _
               Buttons:=vbCritical
    End If
 

dan17602

New Member
Joined
Mar 20, 2011
Messages
9
Hi Mike,

Thats great, exacly the formula I was after. However, when I put this into my existing macro it gives the error and then straight to the debug or end option. Is there a way this can stop the script if error?

Thanks again

Dan
 

Watch MrExcel Video

Forum statistics

Threads
1,109,541
Messages
5,529,437
Members
409,877
Latest member
DDhol
Top