+ Reply to Thread
Results 1 to 6 of 6

No. of Rows determination to place formula in new col

  1. #1
    Registered User
    Join Date
    02-10-2015
    Location
    troy,mi
    MS-Off Ver
    13
    Posts
    3

    No. of Rows determination to place formula in new col

    Greetings,
    I have a conundrum to solve and since my knowledge is lower than a dead elephant (yea, I'm a newbie) I need some help. I would like through VBA determine the number of data filled rows in an active sheet, use that number to place a set formula at the end of each row in that sheet. The formula can change (as I add more col.s by running a similar script). Any ideas?
    Thanks

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: No. of Rows determination to place formula in new col

    Hi sdsmithinc

    Welcome to the Forum!!!

    This will find the last row with Data in the Worksheet:
    Please Login or Register  to view this content.
    This will find the last column with Data in the Worksheet
    Please Login or Register  to view this content.
    This will find the first empty row in the Worksheet
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    02-10-2015
    Location
    troy,mi
    MS-Off Ver
    13
    Posts
    3

    Re: No. of Rows determination to place formula in new col

    Thanks for the reply but using the code(s) only partially solves my issue. The versions you have indicated only show a place marker. I would like to be able to place a predetermine formula at the end of each row that has data then use the same process to create another column with a different formula . So I was thinking I need to determine the number of rows and copy the formula at the end of each row. The formula just compares several cols in each row and creates a number which is used on another sheet. I can use VBA to copy the formula into one cell but I can't figure out how copy the same formula at the end of each row that has data. The work sheet can have any number of rows, does this codify what I'm asking for?

    Range("A" & Rows.Count).End(xlUp).Row [this just errors out]
    [Below is the how I can copy the formula (just for example), but how to copy multiple times at the end of the row
    Range("K2").Select
    ActiveCell.FormulaR1C1 = "=IF(R[-1]C[-10]=RC[-10],100,100)"
    Range("K2").Select
    Last edited by sdsmithinc; 02-15-2015 at 07:10 PM. Reason: additional info

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: No. of Rows determination to place formula in new col

    Hi sdsmithinc

    Having found the
    Please Login or Register  to view this content.
    What's your Formula? You can write it to

    Please Login or Register  to view this content.
    Post a Sample File...perhaps I'll understand better and be able to help.

  5. #5
    Registered User
    Join Date
    02-10-2015
    Location
    troy,mi
    MS-Off Ver
    13
    Posts
    3

    Re: No. of Rows determination to place formula in new col

    Edited post to indicate what if done or at least tried to do:
    Attached Files Attached Files

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: No. of Rows determination to place formula in new col

    Hi sdsmithinc

    In your Sample File, which Columns would you like Totals?

+ 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. Max determination
    By StiaanLaubscher in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-12-2014, 12:54 AM
  2. VBA to place formula in non empty rows
    By Chrisbrough88 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-28-2014, 09:58 AM
  3. Replies: 4
    Last Post: 01-18-2014, 03:24 AM
  4. [SOLVED] Formula to lift multiple information from rows and place it in a separate worksheet
    By Garion in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-13-2013, 06:04 AM
  5. Replies: 5
    Last Post: 06-05-2012, 03:32 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