+ Reply to Thread
Results 1 to 5 of 5

formula autofilled question

  1. #1
    Registered User
    Join Date
    09-25-2007
    Posts
    2

    Angry formula autofilled question

    Hi guys so I pretty much work with data and reports all day long and have created some macros on my own but this time around Im stumped.

    Here is my problem. I have created a report that uses two formulas in say Columns A and Columns B. So I have told the macro to autofill the formula but the problem is sometimes the data on the report can be 200 rows long and sometimes it can be 500 rows long.

    Well when I recorded the macro the data on the report was 200 rows long so now everytime I run the macro the formula is autofilled only up to row 200 so that leaves the rest of the rows without the formula.

    Is there anyway I can tell excel to autofill the formula for all entries and not up to just row 200?

    Any advice would be greatly appreciated.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Is there a column that will always be able to determine the last row of data?


    rylo

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

    You can probably use something like this in your workbook:
    Please Login or Register  to view this content.
    This searches for the bottom row of data in column C. If your longest column is column E or F, adjust the code accordingly ("C65536" to "E65536", for example).

    Rather than using a loop, you could also just determine the longest column and then use that row to fill the formula down in the macro.

  4. #4
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525
    Hi there,

    You need to assign a variable that picks up the last row from a column that you know will have the most data in it and then use this variable in your code. For example, (assuming you're using Excel 2003 and you're on the relevant tab) if Column A has the most rows in it, you could use the following:

    Please Login or Register  to view this content.
    If you get stuck post back with the zipped spreadsheet in question.

    HTH

    Robert

  5. #5
    Registered User
    Join Date
    09-25-2007
    Posts
    2
    Hi guys thx for the response.

    Actually to give you more info the data I work with is always 10 columns long. It other words that never changes. So the data is going to be the same across the 10 columns.

    So lets say tomorrow I download this report. If it has 200 rows of data it's going to be 200 rows across the 10 columns

    I hope I'm making sense. The reason I need to fix this is that it's a pain to type in the formula in A2 and B2 and then drag the formula all the way down to very last row of data.

    Thx for your replies.

+ 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