LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default Force Integer in Inputbox

try this:

ChangeLevel = InputBox(Question3, Title3, Default3 , , , , 1)
the comma's denote the location of the box left, right, help, help context,
type
type 1 is numeric input only and it will automatically display an error
window.


"Alex" wrote:

I have the following code that inputs a value into a cell that is typed in an
input box. How can I force the number that is typed in the input box to be
an integer? Thanks.

Sub Input_Fields()

Dim Question3, Title3, Default3, Box3
Dim ChangeLevel As Integer
Question3 = "What is the Change Level?"
Title3 = "Change Level"
Default3 = ""
ChangeLevel = InputBox(Question3, Title3, Default3)


Range("e5").Select
ActiveCell.FormulaR1C1 = ChangeLevel


End Sub



 
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
How do I add an integer to an existing integer? Aaron Excel Worksheet Functions 3 December 17th 09 09:46 PM
integer integer format Excel Worksheet Functions 1 May 3rd 07 06:45 PM
Force Integer in Inputbox NickHK Excel Programming 2 August 27th 06 01:29 AM
Forcing Integer in InputBox Alex Excel Programming 3 August 14th 06 10:48 PM
Inputbox and Application.InputBox Maria[_7_] Excel Programming 1 September 20th 04 11:36 AM


All times are GMT +1. The time now is 08:56 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"