ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro only in active sheet (https://www.excelbanter.com/excel-programming/338047-macro-only-active-sheet.html)

jobra

macro only in active sheet
 
Hi, How can I program a macro that it only will work in the active worksheet?
Thanks in advance


Tom Ogilvy

macro only in active sheet
 
Do you mean only work on a specific sheet?

--
Regards,
Tom Ogilvy

"jobra" wrote in message
...
Hi, How can I program a macro that it only will work in the active

worksheet?
Thanks in advance




jobra

macro only in active sheet
 
That's exactly what I mean Tom

"Tom Ogilvy" wrote:

Do you mean only work on a specific sheet?

--
Regards,
Tom Ogilvy

"jobra" wrote in message
...
Hi, How can I program a macro that it only will work in the active

worksheet?
Thanks in advance





Tom Ogilvy

macro only in active sheet
 
If Ucase(Activesheet.Name) < Ucase("Sheet3") then Exit sub

at the top of the macro might do what you want

--
Regards,
Tom Ogilvy


"jobra" wrote in message
...
That's exactly what I mean Tom

"Tom Ogilvy" wrote:

Do you mean only work on a specific sheet?

--
Regards,
Tom Ogilvy

"jobra" wrote in message
...
Hi, How can I program a macro that it only will work in the active

worksheet?
Thanks in advance







jobra

macro only in active sheet
 
Thanks a lot. This is working just the way I want it.
Thank you very much

"Tom Ogilvy" wrote:

If Ucase(Activesheet.Name) < Ucase("Sheet3") then Exit sub

at the top of the macro might do what you want

--
Regards,
Tom Ogilvy


"jobra" wrote in message
...
That's exactly what I mean Tom

"Tom Ogilvy" wrote:

Do you mean only work on a specific sheet?

--
Regards,
Tom Ogilvy

"jobra" wrote in message
...
Hi, How can I program a macro that it only will work in the active
worksheet?
Thanks in advance








Jef Gorbach

macro only in active sheet
 

"jobra" wrote in message
...
Hi, How can I program a macro that it only will work in the active

worksheet?
Thanks in advance


Sheets("your sheet name").Activate
then the rest of your code





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

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