Input Box

B

Beep Beep

I have the below VBA in Excel. What I would to do is inhance it to be
prompted to input a number in the line Set rStoreNo = Range("g7:g9753") only
where the 9753 is. The columns will always be the same as will g7. Also I
would like the same for rStoreNo.Value = "0002" where it says "0002".

Sub InputStoreNum()

Dim rStoreNo As Excel.Range

Set rStoreNo = Range("g7:g9753")
rStoreNo.Value = "0002"
Call DeleteRows

End Sub
 
O

OssieMac

Hi,

Something like the following but look up InputBox in help for other
parameters that can be used with it.

Sub InputStoreNum()

Dim rStoreNo As Excel.Range
Dim strInput As String


strInput = InputBox("Enter the row number")

Set rStoreNo = Range("g7:g" & strInput)

rStoreNo.Value = InputBox("Enter the value to insert in range")

Call DeleteRows

End Sub
 
G

Gary''s Student

Sub beep()
x = Application.InputBox(prompt:="Number please", Type:=1)
Set rStoreNo = Range("g7:g" & x)
End Sub
 
Top