+ Reply to Thread
Results 1 to 7 of 7

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

Hybrid View

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

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

    Almost. But still can't get it. Here is an example

    ......A .....B.......C..............................AR.........AS..........AT.......AU.......AV......AW
    .4...xx...xxx.....xxx...........................xxxx......xxxx.......xxxx.....xxxx....xxxx....xxxx
    .5...xx...xxx.....xxx................................................................................................
    .6...xx...xxx.....xxx................................................................................................
    .7...xx...xxx.....xxx................................................................................................
    .8 ..xx...xxx.....xxx...............................................................................................
    .9...xx...xxx.....xxx................................................................................................
    10..xx...xxx.....xxx...............................................................................................


    The spreadsheet would always have values in the first couple of columns. In this case, my last row row is row 10. I would then need to autofill columns AR:AW through row 10.
    I tried you last suggestion, but it only filled one extra row.
    Last edited by mcg7@ntrs.com; 02-20-2010 at 12:37 AM.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

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

    You missed part of my post then.
    If so, based on your example is that column AR?
    Based on your latest post, that is column A (or B or C). So change the code to:
    Range("AR4:AW" & Range("A" & Rows.Count).End(xlUp).Row).FillDown
    This will find the last used row in column A, and use that to set the filldown limit.

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

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

    It worked. Thanks so much. -Marie

+ 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