+ Reply to Thread
Results 1 to 2 of 2

Adding n rows to a named range

  1. #1
    Forum Contributor
    Join Date
    06-25-2007
    Posts
    166

    Adding n rows to a named range

    In cell A1 of sheet2, I have a COUNTIF function that is taking data from Sheet1, so the number is constantly changing.

    I have a named range on sheet2 called Example from B5:C15.

    Is there a way to write a macro that will add rows based on the value in cell A1? For example, if the A1 COUNTIF function returns a value of 5, how can I have excel automatically add 5 rows to the bottom of the range "Example"? Then, if A1 changes, rows are added/subtracted automatically once again?

    Thanks in advance for your help!

  2. #2
    Valued Forum Contributor
    Join Date
    08-26-2006
    Location
    -
    MS-Off Ver
    2010
    Posts
    388
    Have a look at the Calculate Event and the Resize Property of the Range object in VBA help.
    These will lead you to the answer.

+ 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