Results 1 to 6 of 6

[Solved] Define range of formula on VBA based on first blank cell

Threaded View

  1. #1
    Registered User
    Join Date
    12-13-2010
    Location
    Brazil
    MS-Off Ver
    Excel 2003
    Posts
    26

    [Solved] Define range of formula on VBA based on first blank cell

    Hello everybody,

    I'm not an expert in VBA, and I need help for the following problem:

    I have a column with a lot of values that must be summed. The number of filled rows for this column will vary.

    There is a blank row on the top of the column. So far I have this:

    ActiveCell.FormulaR1C1 = "=SUM(R[-530]C:R[-1]C)"
    The only problem is that I don't want a range written like R[-530]:R[-1]C, because the number of rows will vary. I want instead for the macro to find the first blank space before the selected cell and use the first cell under it as the start of the range. The end of the range will be the cell above the formula.

    Any ideas?
    Last edited by kurtwagner; 10-29-2012 at 09:53 AM.

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