+ Reply to Thread
Results 1 to 3 of 3

Assign discrete range values to array variable

  1. #1
    Forum Contributor
    Join Date
    04-18-2009
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2016
    Posts
    269

    Assign discrete range values to array variable

    Hello All,

    I want to assign values from a discrete range to an array variable. For example, I want my variable named 'myarray' to be assigned values of A1:A5, A10:14, A25:A26 of Sheet1.

    Anyone has ideas?

    Thanks,
    Karan
    Last edited by karan; 01-13-2016 at 10:52 AM.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Assign discrete range values to array variable

    Here's an example to experiment with:
    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Contributor
    Join Date
    04-18-2009
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2016
    Posts
    269

    Re: Assign discrete range values to array variable

    Hi Ron,

    I have a very large dataset of around 50000 rows and based on some logic I have to choose some designated discrete range. I was looking for a faster way to achieve this. But, I just figured that I can perform some arithmetic operations on the range itself (rng). So, I'm now using this code:

    Please Login or Register  to view this content.
    Thank you so much for helping out.

    Regards,
    Karan

+ 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. Assign range to a class variable array
    By Lithium in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-07-2015, 11:45 AM
  2. [SOLVED] Assign entire row to variable, how do you paste variable values in a new workbook?
    By tv69 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2013, 08:01 PM
  3. Assign and found range to a variable
    By duckboy1981 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-26-2009, 10:55 AM
  4. Assign Array To Variable
    By CrazyFileMaker in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-19-2009, 05:20 PM
  5. assign variable a value from multidimensional array?
    By gnome_core in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-23-2009, 03:03 PM
  6. assign objects into array or object variable?
    By Fendic in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2005, 05:05 PM
  7. [SOLVED] How to assign a variable in a range select
    By Paul in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-03-2005, 07:05 PM

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