Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
converting email address names in a range of cells to real names John Excel Worksheet Functions 1 May 19th 10 03:44 PM
How to generate random numbers from a range of cells? fruitchunk Excel Worksheet Functions 3 December 7th 07 04:49 AM
select random value in a range of cells Pete Morris Excel Discussion (Misc queries) 4 March 30th 07 09:26 PM
create range of cells with random numbers [email protected] Excel Programming 2 July 28th 06 05:31 PM
random selection from a range of cells tjb Excel Worksheet Functions 1 February 15th 05 06:34 PM


All times are GMT +1. The time now is 05:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"