ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I pause a macro to select specific cells (https://www.excelbanter.com/excel-worksheet-functions/20297-how-do-i-pause-macro-select-specific-cells.html)

lee

How do I pause a macro to select specific cells
 
I am using version Excel 2003 - I need to be able to pause a macro to allow
me to select specific cells (which will be different each time I use the
macro) then continue to run the rest of the macro.

Dave Peterson

You could use application.inputbox()

As in:

dim myRng as range

set myrng = nothing
on error resume next
set myrng = application.inputbox("Select a range", type:=8)
on error goto 0

if myrng is nothing then
'user hit cancel
'what happens here
else
msgbox myrng.address 'do what you want
end if

lee wrote:

I am using version Excel 2003 - I need to be able to pause a macro to allow
me to select specific cells (which will be different each time I use the
macro) then continue to run the rest of the macro.


--

Dave Peterson


All times are GMT +1. The time now is 02:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com