+ Reply to Thread
Results 1 to 7 of 7

Working with ranges

  1. #1
    Registered User
    Join Date
    12-09-2017
    Location
    Israel
    MS-Off Ver
    Office Excel 2007
    Posts
    42

    Working with ranges

    Hello all,
    I need some advice here..
    I've read that if you use vba to read from and write to a range in a sheet, it is much slower, and that it's a much faster (better?) way to load the range to an array first and work with that array instead of directly referring the range in the worksheet for stuff, every time. I tried loading a range to array but I found that the values are the only thing the array get populated with.

    Something like:
    Please Login or Register  to view this content.
    What I need is to gather other properties about each cell in the range I load and not only cell values. Is it possible to load the individual cells as ranges so that I can then check whatever I need in each cell, via the array? Would that make it faster (better performance wise) as oppose to reading directly from the spreadsheet? Or is it be better if I create a custom type that holds only the specific properties (and load them to array)? I only need: front used in the cell, value of cell, cell formula, cell row, cell column, isRowHidden, and isColumnHidden
    I only need these ones so loading an entire cell's (range) property set might be redundant..

    Two more things to consider:
    1. Range size can vary greatly - at times the range to load could be only a few cells, in other times few hundred or even thousand cells.

    2. The loaded properties shouldn't only be static, that is, except for cell row and cell column (which would help me locate the cpecific cell to apply changes to), all other 5 properties should have an affect in the sheet itself (if I load a range where A23 is using Arial, I would be able to set a different font, via a userform).

    I'm not concerned about any of the other things I've mentioned like userform and affecting the sheet via a form..

    My concern here is:
    What is the easiest/best way (performance wise, on the system) to work with potentialy large ranges, where you'd need to read and write to a spreadsheet?

    Thanks!
    Last edited by guyglk; 01-09-2020 at 03:21 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: Working with ranges

    Just to clarify, as you have posted in the Access section - is this an Access or an Excel question?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    12-09-2017
    Location
    Israel
    MS-Off Ver
    Office Excel 2007
    Posts
    42

    Re: Working with ranges

    Oh sorry.. it is an excel question, please disregard.
    I'll re-post this in the excel sect.

    Thanks!

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: Working with ranges

    No - I'll move the thread for you.

  5. #5
    Registered User
    Join Date
    12-09-2017
    Location
    Israel
    MS-Off Ver
    Office Excel 2007
    Posts
    42

    Re: Working with ranges

    Thanks but already did.. hope it's OK..

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: Working with ranges

    No, it wasn't OK - you aren't allowed duplicates (see forum rule #5). I have deleted the new thread and moved this one, so continue here, please.

  7. #7
    Registered User
    Join Date
    12-09-2017
    Location
    Israel
    MS-Off Ver
    Office Excel 2007
    Posts
    42

    Re: Working with ranges

    Thank you AliGw

+ 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] Working with Ranges
    By troussis in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-10-2014, 10:20 PM
  2. [SOLVED] countifs working on extended ranges and different sheets not working
    By etaf in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-18-2013, 02:23 PM
  3. Working with Ranges
    By Gooner in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-25-2009, 11:17 AM
  4. Working with ranges
    By okaderli in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-26-2007, 10:12 PM
  5. Working with Ranges
    By somefred in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-26-2006, 10:04 PM
  6. [SOLVED] Working with ranges
    By denny in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-12-2005, 11:25 AM
  7. Working with Ranges
    By thebside in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-27-2005, 06:55 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