Pause to select cell

  • Thread starter Thread starter Lweiss
  • Start date Start date
L

Lweiss

I have a main spreadsheet that contains a macro that goes to 25 different
spreadsheet and copies information and paste to the main spreadsheet. I
would like to pause the macro after each paste to select the row for the next
spreadsheet. How can I do this?
 
There is no effective way to pause a macro as you have described it. Macro's
are like fireworks. Once the fuse is lit it executes all the way through.
There are a couple of options...

1. You could use a userform with a refedit control on it that the user will
need to use to fill in the cell selection.

2. You could use an inputbox designed to accept only ranges (probably the
best solution for you).

3. You could use event programming to catch a selection change and use that
to initiate your copy.

Sub test()
Dim lng As Long

For lng = 1 To 3
Application.InputBox("Please select a range.", Type:=8).Select
MsgBox Selection.Address
Next lng
End Sub
 
here is the macro

Windows("Weekly Modified Work Report Ariss.xls").Activate
Application.Goto Reference:="Data"
Selection.Copy
Windows("Weekly Modified Work Report.xls").Activate
ActiveSheet.Paste

I want to stop the macro here so that I can go to my main spreadsheet
"Weekly Modified Work Report" to select the cell to run the next macro:

Windows("Weekly Modified Work Report Camtac.xls").Activate
Application.Goto Reference:="Data"
Selection.Copy
Windows("Weekly Modified Work Report.xls").Activate
ActiveSheet.Paste

and so on for 20 spreadsheets.

What is the best way to do this?
 
How about this...

Sub test()

Workbooks("Weekly Modified Work Report Ariss.xls").Names("Data"). _
RefersToRange.Copy Destination:= _
Application.InputBox("Please select a range.", Type:=8)

Workbooks("Weekly Modified Work Report Camtac.xls").Names("Data"). _
RefersToRange.Copy Destination:= _
Application.InputBox("Please select a range.", Type:=8)

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