Results 1 to 7 of 7

Thread: Subtraction Of Series Of Cells' / Array Values

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Senior Member
    Join Date
    Oct 2011
    Posts
    135
    Rep Power
    15
    Hi,

    Thanks to the alternative code, useful to reduce the memory used in the cycle.

    To avoid errors when there is a text, I added in the cycle:

    For i = 1 To UBound(ka, 1) - 1
    ka(i, 1) = Val(ka(i + 1, 1)) - Val(ka(i, 1))
    Next

    Is there an alternative to load the array: ka = Range("C3:C" & r) with only numeric values ?

    I hope my request makes sense

  2. #2
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    662
    Rep Power
    15
    Quote Originally Posted by PcMax View Post
    To avoid errors when there is a text, I added in the cycle:

    For i = 1 To UBound(ka, 1) - 1
    ka(i, 1) = Val(ka(i + 1, 1)) - Val(ka(i, 1))
    Next

    Is there an alternative to load the array: ka = Range("C3:C" & r) with only numeric values ?
    Just double-checking... you are performing a mathematical operation on a column of cells that contain both numbers and non-numbers??? If so, can you show us an example of data in Column C that is like that and also show us the results you want to see from it?

Similar Threads

  1. Replies: 4
    Last Post: 06-10-2013, 01:27 PM
  2. Replies: 1
    Last Post: 12-04-2012, 08:56 AM
  3. counting consecutive values in an array
    By 5ko in forum Excel Help
    Replies: 3
    Last Post: 12-04-2012, 03:49 AM
  4. Replies: 3
    Last Post: 08-05-2012, 09:16 PM
  5. Replies: 3
    Last Post: 04-08-2012, 09:44 AM

Posting Permissions

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