Input Box

  • Thread starter Thread starter Beep Beep
  • Start date Start date
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
 
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
 
Sub beep()
x = Application.InputBox(prompt:="Number please", Type:=1)
Set rStoreNo = Range("g7:g" & x)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top