+ Reply to Thread
Results 1 to 3 of 3

Auto Fill formula with growing data

  1. #1
    Registered User
    Join Date
    05-13-2010
    Location
    Marion, Illinois
    MS-Off Ver
    Excel 2007
    Posts
    43

    Question Auto Fill formula with growing data

    I have the following formula
    Please Login or Register  to view this content.
    And I need to auto fill my workbook
    Please Login or Register  to view this content.
    Is there a way for me to tell my macro what my ending row is? Instead of me putting row number 165882. I have a text file that I import all of my data from. This file is growing all the time and I need to be able to tell my macro to go to the end of the line. Just a example on 5-11-10 the last row was 165882 now it is 175238. So if I run my existing Macro it does not populate out the formulas to the new data. I hope I am explaining what I need to do. Thanks for any help!
    Last edited by chrispulliam; 05-14-2010 at 01:39 PM. Reason: Solved

  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 formula with growing data

    I use a lastrow variable to test a specific column for the last row of data, usually column A, but you can adjust that. Then I use that variable to set the range used in the other columns.
    Please Login or Register  to view this content.


    NOTE: You should get into the habit of editing out the selecting in your macros. You see that in recorded code because it records what you did, but you don't have to select a cell then refer to it as "Selection" or "Activecell" in VBA, you can issue your commands directly to the cells themselves without selecting.
    Last edited by JBeaucaire; 05-14-2010 at 01:01 PM.
    _________________
    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
    05-13-2010
    Location
    Marion, Illinois
    MS-Off Ver
    Excel 2007
    Posts
    43

    Re: Auto Fill formula with growing data

    Sweet! Thanks alot it works like a charm. I will be able to edit this and now repopulate all my formulas this way!

+ 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