Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Input Box Question with Code

Sub Using_InputBox_Method()
Dim Response As Long '<===
Sheets("Annual Profit and Loss").Select

' Run the Input Box.
Response = Application.InputBox("Enter a number.", _
"Number Entry", , 250, 75, , 1)

' Check to see if Cancel was pressed.
If Response < False Then

' If not, write the number to the first cell in the first sheet.
Worksheets("Annual Profit and Loss").Range("c6").Value = Response

MsgBox ("Update Complete.")

End If

End Sub

--
Regards,
Tom Ogilvy

"RBBCPA" wrote in message
...
I am trying to write a macro with an inputbox that allows a user to input

a
number and then put that number in a given cell so that it can be used in
calculations (outside the macro). the code I am using is shown below. I
copied from a posted article on the microsoft site. the problem is that

when
i enter a number larger than 32600, i get a run-time '6' error overflow.

i
can't figure out why. i want to be able to enter numbers between 1000000

and
10000000
Sub Using_InputBox_Method()
Dim Response As Integer
Sheets("Annual Profit and Loss").Select

' Run the Input Box.
Response = Application.InputBox("Enter a number.", _
"Number Entry", , 250, 75, , 1)

' Check to see if Cancel was pressed.
If Response < False Then

' If not, write the number to the first cell in the first sheet.
Worksheets("Annual Profit and Loss").Range("c6").Value = Response

MsgBox ("Update Complete.")

End If

End Sub



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
How to modify the code for different type of input? Eric Excel Worksheet Functions 1 September 1st 07 03:58 PM
Input Box Question with Code Bob Phillips[_6_] Excel Programming 0 August 16th 04 07:29 PM
Input Box Code Please Help!! Struggling Hard!! Excel Programming 3 July 30th 04 12:29 AM
Code for Input Box Laura C Excel Programming 4 June 29th 04 05:27 PM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM


All times are GMT +1. The time now is 07:22 PM.

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"