Results 1 to 7 of 7

autofill in macro range is constant- how can I code to be a variable range?

Threaded View

  1. #1
    Registered User
    Join Date
    01-26-2010
    Location
    united states
    MS-Off Ver
    Excel 2003/Excel 2007
    Posts
    27

    autofill in macro range is constant- how can I code to be a variable range?



    I am trying to write a macro which will autofill specific columns. The macro will set the range from the start of my autofill to the end of my autofill as a constant range.
    The problem I need to get around is the end of my range can always change each time I run the macro. For instance, the first time I run the macro I may only need to autofill from row 4 to row 15. The next time, I may only need to autofill from row 4 to 23 (because of user updates). How can I make the end of my range not be a constant address but variable?


    Range("AR4:AW4").Select
    Selection.AutoFill Destination:=Range("AR4:AW15") <---- 15 changes from day to day
    Last edited by mcg7@ntrs.com; 02-20-2010 at 12:50 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