+ Reply to Thread
Results 1 to 2 of 2

Quickly Update Range

  1. #1
    MDW
    Guest

    Quickly Update Range

    What's the quickest, most efficient way to do something to every cell in a
    range? I've got a range of cells, and I want to do one of the following
    depending on user params:

    1) replace every value with an apostrophe and the value (coercing it to a
    text data type for Access import)
    2) replace every value with the Val() of that value (replacing blank cells
    with 0, again for Access import)

    I'm conversant with the "For Each C In objR.Cells" loop, but I've got
    20,000+ rows and this loop is taking too long.

    Any other suggestions that would accomplish the same thing would be greatly
    apperciated.
    --
    Hmm...they have the Internet on COMPUTERS now!

  2. #2
    Toppers
    Guest

    RE: Quickly Update Range

    Hi,
    Probably the quickest way is to read the range into a variant
    array, perform your calculations and transfer the variant array back to the
    range.

    A very simple emulation of your requirements for 30,000 rows and 50 columns
    took less than 10 secs.

    Is this performance acceptable?

    HTH
    "MDW" wrote:

    > What's the quickest, most efficient way to do something to every cell in a
    > range? I've got a range of cells, and I want to do one of the following
    > depending on user params:
    >
    > 1) replace every value with an apostrophe and the value (coercing it to a
    > text data type for Access import)
    > 2) replace every value with the Val() of that value (replacing blank cells
    > with 0, again for Access import)
    >
    > I'm conversant with the "For Each C In objR.Cells" loop, but I've got
    > 20,000+ rows and this loop is taking too long.
    >
    > Any other suggestions that would accomplish the same thing would be greatly
    > apperciated.
    > --
    > Hmm...they have the Internet on COMPUTERS now!


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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