how can a macro be paused for input and then resume executio

K

Khan

In the following macro in excel please answer the italic question
Range("A1").Select
Selection.End(xlDown).Select
Selection.End(xlDown).Select
ActiveCell.Range("A1:G1").Select
Selection.Copy
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Select
Dim x As String
x = InputBox("Put Value", "abc") ' How can the macro be paused here and
after input what
key will resume it ?
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.Select

End Sub
Thanks for your help
 
M

Mike H

Hi,

Simply displaying an input box in this case pauses you macro waiting for
that input but it isn't immediatly obvious what you are trying to do.Have a
look at my version and post back with what you want to do with the input when
you have it. I've deleted some lines from your code that aren't necessary.

Sub stantially()
Range("A1:G1").Copy
Range("A2").Select
ActiveSheet.Paste
x = InputBox("Put Value", "abc")
ActiveCell.Offset(0, 1).Select
End Sub

Mike
 
S

Subodh Adarkar

The Macro will pause automatically for the user to key in the value. After
the key enter or Ok the macro will continue.

Subodh
 

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