+ Reply to Thread
Results 1 to 4 of 4

Multiple Range variables inside an only Range array

  1. #1
    Registered User
    Join Date
    05-07-2015
    Location
    Angouleme, France
    MS-Off Ver
    2013
    Posts
    48

    Multiple Range variables inside an only Range array

    Hello !

    First of all, I'm not sure of the term "array". But when I was doing VB I often did this :

    Please Login or Register  to view this content.
    What I would like to know is if you can do the same in Excel + VBA by having a different range for e.g. range(1), range(2), range(7)...

    I want to do this because I want to check a list and pick a related range in particular each time this list has a certain value...

    Thank you all !

  2. #2
    Forum Contributor LokeshKumar's Avatar
    Join Date
    03-31-2015
    Location
    India
    MS-Off Ver
    All, mostly 2010 now..
    Posts
    471

    Re: Multiple Range variables inside an only Range array

    Not much clear.. Please upload the workbook...
    Lokesh Kumar
    Stay Hungry.. Stay Foolish..
    _________________________________________________________
    Please Click STAR to Add Reputation if my/someone's answer helped!

  3. #3
    Registered User
    Join Date
    05-07-2015
    Location
    Angouleme, France
    MS-Off Ver
    2013
    Posts
    48

    Re: Multiple Range variables inside an only Range array

    The workbook is pretty much empty at the moment... To try my code, I randomly put "1" or "2" in the cells A1 to A20. What I want my code to do is checking each line and if its content in column A is a "1", the 4 first cells of this line go to a Range variable. For example, A5 contains "1", I want something like RangeName(5) = Range("A5") (which does not work...).

    Sorry for not giving the WB, but it would have not helped at all, trust me !

  4. #4
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: Multiple Range variables inside an only Range array

    hi astrozelda,

    i do not really understand what you're going for here... but it is totally possible to create an array of ranges using the variant type:
    Please Login or Register  to view this content.
    (untested)

    since i'm really not understanding what you're trying to accomplish i just threw a couple generic examples of declaring different ranges in that array... and then at the end there you can see how to call those different ranges from the array using the RangeName(n) syntax...
    Last edited by simarui; 05-07-2015 at 11:46 AM.
    Hope I could help - if your post has been solved don't forget to mark it as such.

    Clicking the * below is a great way to say thanks!

    "Drowning in 10 feet of water isn?t any different than drowning in a million feet. And if you can swim, it doesn?t matter how deep the ocean is. At some level, once you realize you?re in water that?s too deep to stand, you have to have a very different approach," - Joi Ito

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Applying Conditional Formatting to a Range in VBA (range is set by variables)
    By JungleJme in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-12-2013, 08:32 AM
  2. [SOLVED] how to create multiple text files with different variables inside
    By girishbjp in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-09-2013, 11:46 PM
  3. Dynamic range inside array formula with use of match
    By konradz in forum Excel General
    Replies: 2
    Last Post: 06-23-2012, 10:54 AM
  4. cut bordered range depending on contents inside range
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-26-2012, 07:23 AM
  5. Replies: 4
    Last Post: 07-31-2008, 09:04 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1