Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using Excel 2003 SP2.
In providing a series of macros for a workgroup who like to customize their hotkey assignments, I am attempting to allow them to preserve their setup from version to version without retaining multiple versions. My plan is to use a table on a hidden worksheet that sets up their custom assignments when the file loads. UserNames Sprinks Johnny Default Macro Name Macro A a A a Macro B x t x ....etc. Ideally, I would like to search a named range for their username, and either return the column number, or if it is not found, return the column number of the one named "Default". Can someone tell me how to do this? Once the column is determined, I will loop through the list set the key assignments: ' Pseudocode intColumn = ' Expression that returns column number i = 4 ' Data begins in 4th row Do strMacroName = Cells(i, 1).Value strKey = Cells(i,intColumn) Application.MacroOptions Macro:=strMacroName, ShortcutKey:=strKey i = i + 1 Loop Until Cells(i,1).Value = "" Thanks for any assistance. Sprinks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim res as Variant, rng as Range
res = Application.Match(Application.UserName,rows(1),0) if not iserror(res) then set rng = Range("A1:IV1")(1,res) else set rng = Range("F1") ' default end if -- regards, Tom Ogilvy "Sprinks" wrote: I am using Excel 2003 SP2. In providing a series of macros for a workgroup who like to customize their hotkey assignments, I am attempting to allow them to preserve their setup from version to version without retaining multiple versions. My plan is to use a table on a hidden worksheet that sets up their custom assignments when the file loads. UserNames Sprinks Johnny Default Macro Name Macro A a A a Macro B x t x ...etc. Ideally, I would like to search a named range for their username, and either return the column number, or if it is not found, return the column number of the one named "Default". Can someone tell me how to do this? Once the column is determined, I will loop through the list set the key assignments: ' Pseudocode intColumn = ' Expression that returns column number i = 4 ' Data begins in 4th row Do strMacroName = Cells(i, 1).Value strKey = Cells(i,intColumn) Application.MacroOptions Macro:=strMacroName, ShortcutKey:=strKey i = i + 1 Loop Until Cells(i,1).Value = "" Thanks for any assistance. Sprinks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, Tom.
Sprinks "Tom Ogilvy" wrote: Dim res as Variant, rng as Range res = Application.Match(Application.UserName,rows(1),0) if not iserror(res) then set rng = Range("A1:IV1")(1,res) else set rng = Range("F1") ' default end if -- regards, Tom Ogilvy "Sprinks" wrote: I am using Excel 2003 SP2. In providing a series of macros for a workgroup who like to customize their hotkey assignments, I am attempting to allow them to preserve their setup from version to version without retaining multiple versions. My plan is to use a table on a hidden worksheet that sets up their custom assignments when the file loads. UserNames Sprinks Johnny Default Macro Name Macro A a A a Macro B x t x ...etc. Ideally, I would like to search a named range for their username, and either return the column number, or if it is not found, return the column number of the one named "Default". Can someone tell me how to do this? Once the column is determined, I will loop through the list set the key assignments: ' Pseudocode intColumn = ' Expression that returns column number i = 4 ' Data begins in 4th row Do strMacroName = Cells(i, 1).Value strKey = Cells(i,intColumn) Application.MacroOptions Macro:=strMacroName, ShortcutKey:=strKey i = i + 1 Loop Until Cells(i,1).Value = "" Thanks for any assistance. Sprinks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
return text value found most frequently in a column | Excel Worksheet Functions | |||
Vlookup, return zero if not found | Excel Worksheet Functions | |||
Return ROW value for range found | Excel Programming | |||
URGENT -- search in string for a value in another column, if found, return value from next column | Excel Programming | |||
Search column - return row found in long text string | Excel Programming |