Results 1 to 4 of 4

Define dynamic data range

Threaded View

  1. #1
    Registered User
    Join Date
    06-27-2011
    Location
    Columbus, OH
    MS-Off Ver
    Excel 2007
    Posts
    4

    Define dynamic data range

    Hi,
    I want to replace the hardcoded data ranges in my macro recording (shown below) with dynamic data ranges.

        Range("C2").Select
        ActiveCell.FormulaR1C1 = "=COUNTIF(Sheet1!R2C8:R168C8,RC[-2])"
        Selection.Copy
        Range("C3:C105").Select
        ActiveSheet.Paste
    a) My active worksheet has an unknown 'n' number of rows in column A from row A2 onwards.

    b) Column C2 contains a COUNTIF formula on A2 using data from Sheet1, column H rows 2 to 168. Sheet1 row H also contains an unknown number of rows from H2 onwards.

    c) For every row in the range A3 to A'n' the countif formula in C2 is then copied its corresponding range (C3 to C'n').
    Last edited by SH14; 06-28-2011 at 08:19 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