Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default window to enter a number

Hello, again an easy one.

Instead of having this code ActiveCell.FormulaR1C1 = "2" (that enters 2 in
a cell) how to I have a box (ie window ) pop up that askes me each time which
number to enter?

thank you.

Steven.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default window to enter a number

Use an Inputbox

"steven" wrote:

Hello, again an easy one.

Instead of having this code ActiveCell.FormulaR1C1 = "2" (that enters 2 in
a cell) how to I have a box (ie window ) pop up that askes me each time which
number to enter?

thank you.

Steven.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default window to enter a number

Steven,

Use Application.InputBox. E.g.,

Dim V As Variant
V = Application.InputBox(prompt:="Enter a number.", Type:=1)
If V = False Then
Debug.Print "User clicked cancel"
Else
ActiveCell.Value = V
End If

Note that you must use Application.InputBox instead of just InputBox in
order to restrict the valid values to numbers (type:=1).


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"steven" wrote in message
...
Hello, again an easy one.

Instead of having this code ActiveCell.FormulaR1C1 = "2" (that enters 2
in
a cell) how to I have a box (ie window ) pop up that askes me each time
which
number to enter?

thank you.

Steven.



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
HO do I enter a number and have it always appear negative Shorichi Excel Discussion (Misc queries) 2 June 11th 09 02:13 PM
enter a number if equal to another number malik Excel Discussion (Misc queries) 4 February 13th 09 12:40 AM
Why am I getting ### when I enter an accting number and hit enter CC Mac New Users to Excel 1 December 15th 08 09:14 PM
The window opens in a smaller window not full sized window. Rachael Excel Discussion (Misc queries) 0 November 7th 06 09:04 PM
How do I enter formula using % > or < = number? Candace Excel Worksheet Functions 3 May 1st 05 06:41 AM


All times are GMT +1. The time now is 05:06 AM.

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

About Us

"It's about Microsoft Excel"