+ Reply to Thread
Results 1 to 10 of 10

Adding "Lastrow" function to these formulas:

  1. #1
    Registered User
    Join Date
    07-12-2014
    Location
    North Carolina
    MS-Off Ver
    Office 2007
    Posts
    79

    Adding "Lastrow" function to these formulas:

    Hello,
    I've been trying for a few hours now to add Lastrow Functionality to a formula I'm using as it's cycling through over 100,000 empty cells for each formula and making my Macro very very slow. My spreadsheet will have a highly variable number of rows.

    Here's the formula I'm using, along with the Lastrow code that's served me will in the past:

    Please Login or Register  to view this content.
    For anyone who might what to know what this is for (bigger picture), I'm using this code from Ozgrid to count and sum based on font color:
    http://www.ozgrid.com/VBA/sum-count-cells-by-color.htm

    Thanks so much for everyone's help in advance. I've been working on this for too long, I think my brain is going numb (yet it doesn't seem that complicated...?)
    Last edited by FDibbins; 04-25-2015 at 08:05 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Adding "Lastrow" function to these formulas:

    I am just starting to learn VBA myself, but see if this code snippet will help (given to me by another member)...it finds the last row and goes down 1 more row
    Please Login or Register  to view this content.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    07-12-2014
    Location
    North Carolina
    MS-Off Ver
    Office 2007
    Posts
    79

    Re: Adding "Lastrow" function to these formulas:

    I can give that a try, but I'm struggling more with finding a way to integrate the "LastRow" part into my formula- I think it's a relatively simple syntax issue (I Hope). Thanks for posting this though.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Adding "Lastrow" function to these formulas:

    try
    Please Login or Register  to view this content.

  5. #5
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: Adding "Lastrow" function to these formulas:

    You aren't being very specific about what you are doing here. You show two lines of code, one selects a cell, which isn't necessary and slows down your code. Are you looping from cell to cell and putting this formula in the cells to the last row?
    Your last row code looks in column G, but your formula is in column AB and references column C, so what are you doing that needs the last row?

  6. #6
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,565

    Re: Adding "Lastrow" function to these formulas:

    Hi Chad,

    You could also use this non R1C1 reference style (which in my humble opinion is much easier to read):

    Please Login or Register  to view this content.
    Hi Ford,

    given to me by another member
    Nice

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  7. #7
    Registered User
    Join Date
    07-12-2014
    Location
    North Carolina
    MS-Off Ver
    Office 2007
    Posts
    79

    Re: Adding "Lastrow" function to these formulas:

    This is perfect.

    I can't thank you enough!

  8. #8
    Registered User
    Join Date
    07-12-2014
    Location
    North Carolina
    MS-Off Ver
    Office 2007
    Posts
    79

    Re: Adding "Lastrow" function to these formulas:

    Thanks for posting this- I kept trying to use a non-R1C1 format, but I couldn't get it to work- maybe it has to do with the Function the formula is working in conjunction with.

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Adding "Lastrow" function to these formulas:

    You are welvome and thanks for the rep.

    Mental block... Yeah, it sometime happens to me....

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

    Re: Adding "Lastrow" function to these formulas:

    This is perfect.
    I can't thank you enough!
    You're welcome

    If you could mark the thread as solved it would be appreciated

    Regards,

    Robert

+ 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. [SOLVED] Get LastRow using "Find" only works for Col A
    By capson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-20-2015, 11:43 AM
  2. "Add Row" and "Remove Row" Buttons... adding rows with formulas down filled
    By excelatnothing in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-15-2015, 02:44 AM
  3. Adding multiple "find" with "left" /"Right"
    By Daniel1 in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 02-22-2014, 04:33 PM
  4. How to transpose data into range ("A1:G" & lastrow)
    By jasondu in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-06-2012, 10:39 AM
  5. Recognize "formulas "result" as "typed data", through and through.
    By gandolff in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-13-2009, 01:30 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