Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA: rename a variable
hi folks, my problem is the following: i want to rename a variable with a name that could be entered as a parameter to the subroutine, a la: sub addvariables(var1, var2, NameOfVar3) var3 = var1 + var2 rename var3 as NameOfVar3 'pseudo-code!!! sub end how can i "rename" var3 into "NameOfVar3". i need the new name for further referencing. thanx in advance, felix ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
rename a variable
Hi Felix,
What is it that you are trying to do? Maybe we can come up with a different solution. I've never encountered a situation where I had to rename a variable. -- Regards, Jake Marx MS MVP - Excel www.longhead.com [please keep replies in the newsgroup - email address unmonitored] qwerqtzui wrote: hi folks, my problem is the following: i want to rename a variable with a name that could be entered as a parameter to the subroutine, a la: sub addvariables(var1, var2, NameOfVar3) var3 = var1 + var2 rename var3 as NameOfVar3 'pseudo-code!!! sub end how can i "rename" var3 into "NameOfVar3". i need the new name for further referencing. thanx in advance, felix ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA: rename a variable
Hi Jake, I want to program a simple matrix addition that I can easily call within vba. It should return the resulting matrix. Can you help me with that? Thanx, Felix ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA: rename a variable
Are the matrices in question in Excel ranges, or are they in memory (as
arrays)? If they are in ranges, you can do something like this: 1) Select the range that you would like the resulting matrix to be placed in (must be same size as matrices to be added). 2) Type =, then select your first matrix, then type +, then select you second matrix, and so on. 3) Use Ctrl+Shift+Enter to enter the formula (that lets Excel know it's an array formula). That should fill the selected range with the sum of the other matrices. If the matrices are in memory, you'll have to loop through the elements of each matrix and add them up. I think a search of groups.google.com would assist you with this. -- Regards, Jake Marx MS MVP - Excel www.longhead.com [please keep replies in the newsgroup - email address unmonitored] qwerqtzui wrote: Hi Jake, I want to program a simple matrix addition that I can easily call within vba. It should return the resulting matrix. Can you help me with that? Thanx, Felix ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do i rename a sheet if the rename tab is inactive? | Excel Worksheet Functions | |||
Runtime Error '91' Object variable or With block variable not set | Excel Discussion (Misc queries) | |||
variable height variable width stacked bar charts | Charts and Charting in Excel | |||
Sum cells based on a row variable and seperate column variable | Excel Worksheet Functions | |||
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? | Excel Worksheet Functions |