Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Specify range within current region (WinNT/XL97)

    This is driving me mad! I need to autofill cell F1 of a range into F2 and down to the last row of the currentregion, without knowing how many rows this will be. I've tried every way of phrasing it I can think of and XL just keeps saying "nope, try again."

    Someone please tell me how to phrase this!

    Please! <img src=/S/grovel.gif border=0 alt=grovel width=31 height=23>
    Beryl M


  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Specify range within current region (WinNT/XL97)

    Try

    Dim lngRows As Long
    lngRows = Range("F1").CurrentRegion.Rows.Count
    Range("F1").AutoFill Range(Range("F1"), Range("F" & lngRows))

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Specify range within current region (WinNT/XL97)

    Thanks, Hans! Perfect solution (as usual!).

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>
    Beryl M


  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Specify range within current region (WinNT/XL97)

    <post#=332972>post 332972</post#> has a generic autofill routine that may be of some use...

    Steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •