+ Reply to Thread
Results 1 to 6 of 6

Auto fill a range based on another cell

  1. #1
    Registered User
    Join Date
    07-28-2009
    Location
    Chicago, Il
    MS-Off Ver
    Excel 2007
    Posts
    67

    Auto fill a range based on another cell

    Hello all,
    I am having a problem and need some assistance. I am auto filling a range of cells on O2 down with a formula and have it stoping all the way down at O12982, the problem i have is that my data can stop before or after that point depending on the report. so how can i say that it should auto fill as long as there is data in A column

    Please Login or Register  to view this content.
    Thanks
    Last edited by Ricardo9211; 07-29-2009 at 04:29 PM. Reason: did not code listed correctly

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Auto fill a range based on another cell

    Hi Ricardo, you'll need to EDIT that first post and GO ADVANCED, then highlight the code and click on the # icon to wrap it in [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags. It's a firmly enforced rule. will look like this:
    Please Login or Register  to view this content.
    Then I can give you the code you need, pretty straightforward stuff.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    07-28-2009
    Location
    Chicago, Il
    MS-Off Ver
    Excel 2007
    Posts
    67

    Re: Auto fill a range based on another cell

    Sorry about that its now corrected..

    Thanks

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Auto fill a range based on another cell

    One approach is to declare and solve the "last row" variable and skip the autofill, just enter the formula directly into the entire range:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-28-2009
    Location
    Chicago, Il
    MS-Off Ver
    Excel 2007
    Posts
    67

    Re: Auto fill a range based on another cell

    now i am still fairly new at this but in this macro i already have a DIM at the beginning can i have another DIM in the same macro?

    Thanks

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Auto fill a range based on another cell

    All variables should be declared, so yes, you can have as many declarations as you need. Some people list all declarations separately, others (like me) group them:
    Please Login or Register  to view this content.

+ 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