Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
require password each time a macro is executed
If you can pick out something unique for that type of worksheet, then you can
test that to see if it's there. For instance, if you have headers in A1:X1 and A1 always contains the text: "Order Number" you could put this at the top of your code: sub testme() if activesheet.range("a1").value < "Order Number" then msgbox "Not on this sheet" exit sub end if 'your other code here end sub The question now becomes: Can you find something unique? Marty wrote: 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. -- Dave Peterson |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro get executed twice | Excel Discussion (Misc queries) | |||
Require a macro for Excel 2007 | New Users to Excel | |||
require macro or code for purchase order to do the following: | Excel Worksheet Functions | |||
Parameter Query executed from a Macro | Excel Programming | |||
Macro not executed Excel -- PowerPoint | Excel Programming |