Results 1 to 6 of 6

Data from all cells in a range

Threaded View

jn_mohit Data from all cells in a range 02-09-2007, 04:54 PM
mudraker Simple coding error Use ... 02-09-2007, 05:35 PM
jn_mohit What if I am getting the data... 02-09-2007, 05:44 PM
mudraker Can you post the code using... 02-09-2007, 06:07 PM
jn_mohit Here's how I am doing it 02-12-2007, 10:38 AM
mudraker I know understand your... 02-13-2007, 02:42 AM
  1. #1
    Registered User
    Join Date
    07-08-2005
    Posts
    11

    Data from all cells in a range

    I am writing a program which would take in a range as an input and do some calculations from the value of cells in the selected range.

    I am able to get this as long as I give a single range as input but i get an error for range with multiple areas. What could be done about this.

    Here's simplified version of my program (which only calculates SUM but that is not what I want to do)

     
        Dim rRange as range
        running_total = 0
        set rRange = Range("A1")
    Dim rcell As Range
        For Each rcell In rRange
               running_total = running_total + rcell.Value
        Next rcell
    
    if I set 
     rRange = Range("A1:A10") ---- Pass
    rRange = Range("A1, A2, A3") ---- Fail
    rRange = Range("A1:D10") ---- Pass
    rRange = Range("A1:A10,D1:D10") --- Fail

    Please let me know how can i get around this.

    Thank you
    Last edited by VBA Noob; 02-09-2007 at 05:14 PM.

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