Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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 ....
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Excel if and else statement

What you have there does not even compile. Does this work for you...

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

--
HTH...

Jim Thomlinson


"millwalll" wrote:

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 ....

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF statement inside a SUMIF statement.... or alternative method Sungibungi Excel Worksheet Functions 3 December 4th 09 06:22 PM
Reconcile Bank statement & Credit card statement & accounting data Bklynhyc Excel Worksheet Functions 0 October 7th 09 09:07 PM
Embedding an OR statement in an IF statement efficiently Chatnoir11 Excel Discussion (Misc queries) 4 February 2nd 09 08:12 PM
appending and IF statement to an existing IF statement spence Excel Worksheet Functions 1 February 28th 06 11:00 PM
Excel VBA- If Then statement tam76131 Excel Programming 3 August 18th 04 03:53 AM


All times are GMT +1. The time now is 04:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"