Using Data from Input Box

danenorman13

New Member
Joined
Jul 14, 2011
Messages
5
I need to be able to use the numeric data that is entered into a input box to number a column. I am trying to ask how many test runs were completed then sending that count 1-### to another sheet, I would like numbering to start at B3 if I could. I have the input box I believe:

Dim lNum As Long

On Error Resume Next
Application.DisplayAlerts = False
lNum = Application.InputBox _
(Prompt:="Please enter how many test were run.", _
Title:="Number of Tests Run", Type:=1)
On Error GoTo 0
Application.DisplayAlerts = True

If lNum = 0 Then
Exit Sub


Any help is greatly appreciated, thanks!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Quick and dirty, it goes like this:

Code:
If lNum = 0 Then
  Exit Sub
End If

For iNum = 1 to lNum
  Worksheets("Sheet 2").Range("B2").Offset(lNum).Value = lNum
Next
 
Upvote 0
That variable is lNum, the first character being a lower case "L", not a numeral one. You even declared it in your first bit o' code.
 
Upvote 0

Forum statistics

Threads
1,224,537
Messages
6,179,408
Members
452,912
Latest member
alicemil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top