+ Reply to Thread
Results 1 to 11 of 11

Adding a range in VBA

  1. #1
    Registered User
    Join Date
    05-11-2006
    Posts
    11

    Adding a range in VBA

    I need to Add/Sum a Range(A Column) in Code I know the Top and the Bottom, but do not know how to work with R1C1 Data Here is the code I have all works except the ActiveCell.FormulaR1C1 Line.
    When I try to use my reference points it fails.
    The TOP and BOTTOM will change based on the data inputed.

    How can I use my Top and Bottom Reference Points?

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    No need to select.

    See if this points you in the right direction

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    05-11-2006
    Posts
    11

    Missing something

    I could not get it to work
    Even if I used it like this:
    Please Login or Register  to view this content.
    I did not get any results on the Sheet

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    That the trouble with only giving a bit of the code. You get a bit of an answer.

    I notice a
    '
    in the autofill line which will stop that line from running

    '.AutoFill
    VBA Noob

  5. #5
    Registered User
    Join Date
    05-11-2006
    Posts
    11

    Still Somewrong

    I did have a ' on that line once removed it wrote Zero's in H6 the TOP all the way down thru H53 Bottom + 6.


    No Sum

    Bill

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Bill,

    You are selecting (which you should also avoid) H6 to H47 and then asking it to insert the formula
    Please Login or Register  to view this content.
    this will return a circular ref.

    If you want help I suggest you post a sample with explaination of what your after

    Please Login or Register  to view this content.
    VBA Noob

  7. #7
    Registered User
    Join Date
    05-11-2006
    Posts
    11

    Here is what I'm Tring to do

    Top and Bottom are VARIANT
    Since I always Know the top and bottom and the columns remain the same I just need to total them

    Please Login or Register  to view this content.

    Thanks
    Bill

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Top and Bottom are VARIANT
    I was expected to see a sample workbook with all the code explaining the variable part

    VBA Noob

  9. #9
    Registered User
    Join Date
    05-11-2006
    Posts
    11

    Sorry Here it is In the UnRun Condition

    Here is the whole file
    Attached Files Attached Files

  10. #10
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

    Please Login or Register  to view this content.
    VBA Noob

  11. #11
    Registered User
    Join Date
    05-11-2006
    Posts
    11

    Smile Thanks

    Thank you That works Great

+ 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