Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
random range of cells via cell names
There was an earlier post about how to construct a range of random cells. The examples used cell addresses like "A5, A6 ... and so on.
I've tried 100 times and I can't figure out how to do this with named cells. I'd like to do something like define the range with "cell_name_total", "cell_name_sum" ... I just can get it to go. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
random range of cells via cell names
There was an earlier post about how to construct a range of random
cells. The examples used cell addresses like "A5, A6 ... and so on. I've tried 100 times and I can't figure out how to do this with named cells. I'd like to do something like define the range with "cell_name_total", "cell_name_sum" ... I just can get it to go. Thanks. Substitute the sample cell addresses with your cell names... -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
random range of cells via cell names
On Tuesday, February 18, 2014 9:52:13 PM UTC-6, GS wrote:
There was an earlier post about how to construct a range of random cells. The examples used cell addresses like "A5, A6 ... and so on. I've tried 100 times and I can't figure out how to do this with named cells. I'd like to do something like define the range with "cell_name_total", "cell_name_sum" ... I just can get it to go. Thanks. Substitute the sample cell addresses with your cell names... -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion I tried these and none worked. Can you spot the silly thing I'm doing wrong? Set rgRandomCells = myWs.Range(Cells("thisisa1"), Cells("thisisa2"),Cells("thisis23")) Set rgRandomCells = myWs.Range(myWs.Range("thisisa1"), myWs.Range("thisisa1")) Set rgRandomCells = myWs.Range("thisisa1, thisisa2") |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
random range of cells via cell names
Try...
Set rgRandomCells = myWs.Range("thisisa1", "thisisa2") OR Set rgRandomCells = myWs.Range("thisisa1", "thisisb3") ...to access A1:A2 OR A1:B3 as a block. To access as separate try... const sMyRanges$ = "thisisa1,thisisa2,thisisb3" Dim n For Each n In Split(sMyRanges, ",") MsgBox Range(n).Address Next 'n -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
converting email address names in a range of cells to real names | Excel Worksheet Functions | |||
How to generate random numbers from a range of cells? | Excel Worksheet Functions | |||
select random value in a range of cells | Excel Discussion (Misc queries) | |||
create range of cells with random numbers | Excel Programming | |||
random selection from a range of cells | Excel Worksheet Functions |