Thread: Error Alert
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Error Alert

a,
Add the check for cell content to the beginning of your macro...

If Len(Range("A1") + Len(Range("A2") + Len(Range("A3") = 0 Then
Msgbox "An entry is required on the worksheet. "
Exit Sub
End If

Jim Cone
San Francisco, USA


"anar_baku"

wrote in message

Hi guys,
This should be straighforward, but I can't figure out. Please help:
I have created a text box that when clicked on runs a macro.
So currently:
1. User clicks on the TextBox
2. Specified Macro is run
and I want:
1. User clicks on the TextBox
2. Excel checks if at least one of the 3 cells (A1, A2, A3) has a value
in it
if Yes then it runs the Macro as planned
if Not then it brings up an error message asking the user to enter a
value in any of the cells (A1, A2 or A3).
Thanks for your help
--
anar_baku