![]() |
Issue with creating a specific macro where two conditions exist
I am trying to create a macro where apon clicking a commandbutton in a user form assigned to a specific defintion it will go directly to a specific cell within a specific range. For example if the user named Brian Monaghan clicks on the button for the definiton of analytics I want him to be taken to the Analytics cell for the range assigned the name of "Brian_Monaghan" and not be able to click on any other range in the worksheet titled Employee_Tasks_Tracker_MOCK3. After I do that do I need to create a nested loop to have this done for every single employee or do I just have to manually enter all of them in there. I apologize if this question is confusing I am a novice at Macros and am having to learn on the fly. |
Issue with creating a specific macro where two conditions exist
Hi Brian,
I would suggest taking a look at the Select Case Statement. It executes one of several groups of statements, depending on the value of an expression. I would also suggest naming the ranges you would like to have each user access with their name and them protect all other ranges or hide the contents (by changing the color of the cell text) so that only the person whose name is assigned to that range will be able to access it. Hope that helps! BrianMo wrote: I am trying to create a macro where apon clicking a commandbutton in a user form assigned to a specific defintion it will go directly to a specific cell within a specific range. For example if the user named Brian Monaghan clicks on the button for the definiton of analytics I want him to be taken to the Analytics cell for the range assigned the name of "Brian_Monaghan" and not be able to click on any other range in the worksheet titled Employee_Tasks_Tracker_MOCK3. After I do that do I need to create a nested loop to have this done for every single employee or do I just have to manually enter all of them in there. I apologize if this question is confusing I am a novice at Macros and am having to learn on the fly. |
Issue with creating a specific macro where two conditions exis
Herb thanks for the tip on the select case statement that worked out
perfectly now the only trouble I am having is protecting the other named ranges. I tried to create a macro where it unlocked the range for only one specific range name as defined by the button that is pushed but for some reason the code error says I can't set the locked property=false. Is there another way to do this or is their an adjustment I can make to the code I have. " wrote: Hi Brian, I would suggest taking a look at the Select Case Statement. It executes one of several groups of statements, depending on the value of an expression. I would also suggest naming the ranges you would like to have each user access with their name and them protect all other ranges or hide the contents (by changing the color of the cell text) so that only the person whose name is assigned to that range will be able to access it. Hope that helps! BrianMo wrote: I am trying to create a macro where apon clicking a commandbutton in a user form assigned to a specific defintion it will go directly to a specific cell within a specific range. For example if the user named Brian Monaghan clicks on the button for the definiton of analytics I want him to be taken to the Analytics cell for the range assigned the name of "Brian_Monaghan" and not be able to click on any other range in the worksheet titled Employee_Tasks_Tracker_MOCK3. After I do that do I need to create a nested loop to have this done for every single employee or do I just have to manually enter all of them in there. I apologize if this question is confusing I am a novice at Macros and am having to learn on the fly. |
All times are GMT +1. The time now is 05:48 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com