ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pause Macro (https://www.excelbanter.com/excel-programming/358893-pause-macro.html)

cottage6

Pause Macro
 
I'd like to pause a macro while the user deletes some rows, then have them
click OK when they're ready to run the insert formulas macro. I looked at
some of the solutions here, but wondered what the easiest way is. I'm not
using any user forms. TIA

Norman Jones

Pause Macro
 
Hi Cottage6,

Try something like:
'=============
Public Sub Tester()
Dim res As Range

On Error Resume Next
Set res = Application.InputBox(Prompt:="Select rows to delete", _
Type:=8)
On Error GoTo 0

If Not res Is Nothing Then
res.EntireRow.Delete
End If

'your subsequent code

End Sub
'<<=============


---
Regards,
Norman


"cottage6" wrote in message
...
I'd like to pause a macro while the user deletes some rows, then have them
click OK when they're ready to run the insert formulas macro. I looked at
some of the solutions here, but wondered what the easiest way is. I'm not
using any user forms. TIA




cottage6

Pause Macro
 
Brilliant, Norman. Thanks a lot. I've been wondering how to do this for
awhile.

"Norman Jones" wrote:

Hi Cottage6,

Try something like:
'=============
Public Sub Tester()
Dim res As Range

On Error Resume Next
Set res = Application.InputBox(Prompt:="Select rows to delete", _
Type:=8)
On Error GoTo 0

If Not res Is Nothing Then
res.EntireRow.Delete
End If

'your subsequent code

End Sub
'<<=============


---
Regards,
Norman


"cottage6" wrote in message
...
I'd like to pause a macro while the user deletes some rows, then have them
click OK when they're ready to run the insert formulas macro. I looked at
some of the solutions here, but wondered what the easiest way is. I'm not
using any user forms. TIA






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

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