View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
millwalll millwalll is offline
external usenet poster
 
Posts: 31
Default Excel if and else statement

Hi all need some help


Problem
I have a excel page and I want the user to enter his/her name in cell b4. I
want to validate this by saying if there is nothing entered in that field
they get a pop up saying enter your name please. If their name is entered I
want it to carry on running at the moment it seem to tell them to enter
their name even if they have entered it.


If Sheet2.Range("b4").Value = "" Then
MsgBox ("Please enter your Name")
Else: Sheet2.Range("a2").Value = (Sheet1.Range("b4").Value
end if


any help would be amazing thanks guys/girls ....