Excel 2000 question.

T

techjohnny

Hello, Group:

I am looking to run a macro that pauses for input. For example to
bend metal, I would like to have the macro ask for number of bends,
then continue in the computation.

Thanks,

--tj
 
B

Bob Phillips

Dim numBends As Long

On Error Resume Next
numBends = InputBox("Number of bends")
On Error GoTo 0
If numBends > 0 Then

'rest of code
End If
 
D

Dave Peterson

Another one...

dim BendCount as long
bendcount = application.inputbox(Prompt:="how many bends",type:=1)
if bendcount < 1 then
exit sub
elseif bendcount > 333 then
'some sort of typing check -- shouldn't exceed what???
msgbox "that's too many!"
exit sub
end if

Application.inputbox with type:=1 will only accept a number.
 

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

Top