Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() There is nothing built into VBA that will let you do as you ask. One way, if variables names must beginning with underscore char (to avoid problems with cell names) is to use "named ranges": Sub createNames() 'run only one time Dim j As Long For j = 1 To 100 ThisWorkbook.Names.Add Name:="_aa" & j, RefersTo:=0, Visible:=False Next End Sub Sub writeNames() Dim j As Long 'run only one time For j = 1 To 100 ThisWorkbook.Names("_aa" & j).RefersTo = 9 Next End Sub Sub readNames() Dim j As Long 'run only one time For j = 1 To 10 Debug.Print Application.Evaluate(ThisWorkbook.Names("_aa" & j).RefersTo) Next End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
clearing array variables and using an array to determine min value | Excel Programming | |||
Array variables | Excel Programming | |||
Creating sequential variables on the fly | Excel Programming | |||
How can I create an array formula for non-sequential cells | Excel Worksheet Functions | |||
Non-sequential VLOOKUP function -OR- sequential sort of web query | Excel Worksheet Functions |