Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Pause macro for user cell address input

Say I write a VB macro to copy and paste some data. But
each time I need to paste the data in a slightly different
location. I would like the macro to pause for me to
select a target cell and then press [enter](or do the same
with a mouse), at which point the macro would continue
running.

Thanks, Ed

P.S. I think this was a question mark surrounded by
brackets {?} in Lotus 123.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Pause macro for user cell address input

Ed

Found this using Google Search (don't know what version you are using
but this might help) (later versions of Excel support modeless forms for
selecting)

However, Stephen Bullen has developed code that allows you to have modeless
userforms in Excel 97. Download FormFun.xls from his site:

http://www.bmsltd.co.uk/Excel/Default.htm

--
sb
"Ed Haslam" wrote in message
...
Say I write a VB macro to copy and paste some data. But
each time I need to paste the data in a slightly different
location. I would like the macro to pause for me to
select a target cell and then press [enter](or do the same
with a mouse), at which point the macro would continue
running.

Thanks, Ed

P.S. I think this was a question mark surrounded by
brackets {?} in Lotus 123.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Pause macro for user cell address input

Ed,

Use Application.InputBox with a Type value of 8. This will allow the user to
select a range. E.g.,

Dim Rng As Range
On Error Resume Next
Set Rng = Application.InputBox(prompt:="Choose A Range", Type:=8)
If Rng Is Nothing Then
' user didn't select anything
Else
MsgBox "You selected " & Rng.Address
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com



"Ed Haslam" wrote in message
...
Say I write a VB macro to copy and paste some data. But
each time I need to paste the data in a slightly different
location. I would like the macro to pause for me to
select a target cell and then press [enter](or do the same
with a mouse), at which point the macro would continue
running.

Thanks, Ed

P.S. I think this was a question mark surrounded by
brackets {?} in Lotus 123.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Macro: Pause & ask user: "Are you sure you want to continue? RoBear! Excel Discussion (Misc queries) 6 March 13th 08 09:14 AM
PAUSE EXCEL MACRO FOR INPUT OF DATA VARIABLE lynne b Excel Discussion (Misc queries) 3 September 11th 06 03:37 PM
Can you pause a macro in excel to input data and continue? Hutch Excel Discussion (Misc queries) 1 May 5th 06 06:16 PM
Macro to pause for user input in dialog box kayabob Excel Discussion (Misc queries) 1 June 22nd 05 07:49 PM
Macro to move to specified cells, pause for input at each? Pete in Montrose Excel Discussion (Misc queries) 1 March 5th 05 06:18 PM


All times are GMT +1. The time now is 06:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"