LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Input Dialog Box

Paste the following code in the sheet module :

Private Sub Worksheet_Change(ByVal Target As Range)
' macro exits if address < B1
If Target.Address < "$B$1" Then Exit Sub
Dim Number
' sets "number" to a non numeric value
Number = ""
'if B1 =yes, whatever the characters case
If LCase(Target) = "yes" Then
' loop until answer is correct
Do Until IsNumeric(Number) = True And Number = 0 And Number < 101
Number = InputBox("Enter number 1-100")
' cell A1 gets the number
[A1] = Number
Loop
ElseIf LCase(Target) = "no" Then
[A1] = 0
Else
MsgBox "Cell B1 value is neither ""Yes"" nor ""No"""
End If
End Sub

--
Regards.
Daniel
"NoviceExcelUser" a écrit dans
le message de news: ...
I am trying to create a dialog box in one cell which checks value in
another
cell (e.g. yes or no) and if it is true, then asks for a value number
(1-100)
and if it is not then enters a zero. Can anybody help with this box, I am
novice use of excel so a step by step instructiion will be greatly
appreciated. Or you can refer me to a website or tutorial. Thanks



 
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
Input Dialog box NoviceExcelUser New Users to Excel 1 September 29th 08 11:00 PM
dialog box to input data? DanGSB Excel Worksheet Functions 0 September 13th 07 03:38 AM
Input Dialog Box - change cell data MacroLearning Excel Programming 1 February 12th 07 06:08 PM
Input Dialog Box - Simple Question sharpie00 Excel Programming 3 December 15th 05 06:59 PM
Macro to pause for user input in dialog box kayabob Excel Discussion (Misc queries) 1 June 22nd 05 07:49 PM


All times are GMT +1. The time now is 11:33 PM.

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"