Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 49956

Macro not to run in a specific range

$
0
0
Hello,

I am using the below macro to delete row:

HTML Code:

Sub REMOVE()
ActiveSheet.Unprotect Password:="P@ssw0rd!"
Set Rng = ActiveCell
ActiveCell.EntireRow.Delete
ActiveSheet.Protect Password:="P@ssw0rd!"
End Sub

However I would like not to apply that macro when I am in the row 12:26! btw, I am running my script by pressing CTRL + D

Would you know how to do that?

Last thing would it also be possible to "extend" the exception to another range ? (name manager -> row 84:276 called "NEXT") if possible to define two name manager for the exception to implement to the existing macro.

Many Thanks,
Graig

Viewing all articles
Browse latest Browse all 49956

Trending Articles