![]() |
require password each time a macro is executed
Workbook contains serveral worksheets with a number of macros. If the wrong
macro is executed for a given worksheet it will ruin the integrity of the worksheet. How do I avoid this problem other than using passwords. |
require password each time a macro is executed
Workbook contains serveral worksheets with a number of macros. If th wrong macro is executed for a given worksheet it will ruin the integrity o the worksheet. How do I avoid this problem other than using passwords. Hi Marty If you know which macro should by run in which sheet, then code it s it checks the sheet before running. Post back if you requir help.........in coding this ... but give details -- Ivan F Moal ----------------------------------------------------------------------- Ivan F Moala's Profile: http://www.excelforum.com/member.php...nfo&userid=195 View this thread: http://www.excelforum.com/showthread.php?threadid=26785 |
require password each time a macro is executed
Include a line in your code which checks that the required worksheet is
selected before the macro continues. "Marty" wrote in message ... Workbook contains serveral worksheets with a number of macros. If the wrong macro is executed for a given worksheet it will ruin the integrity of the worksheet. How do I avoid this problem other than using passwords. |
require password each time a macro is executed
Thanks Ivan,
I understand but is this an if statement and how do you write it? Marty "Ivan F Moala" wrote: Workbook contains serveral worksheets with a number of macros. If the wrong macro is executed for a given worksheet it will ruin the integrity of the worksheet. How do I avoid this problem other than using passwords. Hi Marty If you know which macro should by run in which sheet, then code it so it checks the sheet before running. Post back if you require help.........in coding this ... but give details. -- Ivan F Moala ------------------------------------------------------------------------ Ivan F Moala's Profile: http://www.excelforum.com/member.php...fo&userid=1954 View this thread: http://www.excelforum.com/showthread...hreadid=267852 |
require password each time a macro is executed
Thanks Bigwheel,
I am rather new at this and understand your answere but have no idea how to write it . Can you help? Thanks again Marty "bigwheel" wrote: Include a line in your code which checks that the required worksheet is selected before the macro continues. "Marty" wrote in message ... Workbook contains serveral worksheets with a number of macros. If the wrong macro is executed for a given worksheet it will ruin the integrity of the worksheet. How do I avoid this problem other than using passwords. |
require password each time a macro is executed
Sub Macro1()
if lcase(Activesheet.Name) < "sheet1" then msgbox "Sheet2 must be active to run this macro" exit sub End if ' existing code that works on the active sheet. End Sub "Marty" wrote in message ... Thanks Ivan, I understand but is this an if statement and how do you write it? Marty "Ivan F Moala" wrote: Workbook contains serveral worksheets with a number of macros. If the wrong macro is executed for a given worksheet it will ruin the integrity of the worksheet. How do I avoid this problem other than using passwords. Hi Marty If you know which macro should by run in which sheet, then code it so it checks the sheet before running. Post back if you require help.........in coding this ... but give details. -- Ivan F Moala ------------------------------------------------------------------------ Ivan F Moala's Profile: http://www.excelforum.com/member.php...fo&userid=1954 View this thread: http://www.excelforum.com/showthread...hreadid=267852 |
All times are GMT +1. The time now is 03:42 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com