+ Reply to Thread
Results 1 to 6 of 6

How do you use a variable range with autofill?

  1. #1
    Forum Contributor
    Join Date
    04-01-2010
    Location
    USA
    MS-Off Ver
    Office 2021
    Posts
    185

    How do you use a variable range with autofill?

    All I'm trying to do is start with a range and then autofill based on a variable that the user enters for the number of tenants. For this part what I have now is this:

    Please Login or Register  to view this content.
    I recorded a macro to try and figure out autofill, but can't get that line to work. How do you put a variable in place of a fixed range?

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,271

    Re: How do you use a variable range with autofill?

    ???
    Please Login or Register  to view this content.
    ???
    Last edited by mjr veverka; 04-07-2022 at 01:36 PM.

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,657

    Re: How do you use a variable range with autofill?

    One way:
    PHP Code: 
    Sub AutofillNm()
    Dim TenNum As IntegerstartRng As Range
    TenNum 
    InputBox("How many tenants")
    Set startRng Range("N12")
    startRng.Offset(10).Resize(TenNum 1).Value Range("N12").Value
    End Sub 
    Quang PT

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,789

    Re: How do you use a variable range with autofill?

    Another option
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    04-01-2010
    Location
    USA
    MS-Off Ver
    Office 2021
    Posts
    185

    Re: How do you use a variable range with autofill?

    I don't know how to write "solved" on here, but I got it now. Appreciate everyone's help!

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,789

    Re: How do you use a variable range with autofill?

    Glad to help & thanks for the feedback.
    To mark as solved click on the "Thread Tools" button at the top of the thread & it should be in there.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Vba to autofill variable range across workbook
    By max8719 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-17-2016, 10:48 AM
  2. [SOLVED] Autofill Variable Range
    By efarkouh in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-23-2014, 02:32 PM
  3. Autofill with a variable range
    By Jbm444 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-23-2010, 04:37 PM
  4. VBA .Range autofill variable column same row
    By Zaeguzah in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-04-2010, 07:24 AM
  5. autofill in macro range is constant- how can I code to be a variable range?
    By mcg7@ntrs.com in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-20-2010, 12:44 AM
  6. AutoFill, can the last cell in range be variable?
    By AdamParker in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-02-2008, 04:09 PM
  7. autofill variable range
    By PaulSin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2006, 08:52 PM

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