Consolidate rows with a macro based on lack of value in certain columns
Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Consolidate rows with a macro based on lack of value in certain columns

  1. #11
    MrExcel MVP
    Join Date
    Jan 2008
    Posts
    14,834
    Post Thanks / Like
    Mentioned
    26 Post(s)
    Tagged
    12 Thread(s)

    Default Re: Consolidate rows with a macro based on lack of value in certain columns

    You're welcome.
    The new last row number after running the code is the value of the variable "c".
    So, the next row after that is "c+1", so for column "A" this is:- cells(c+1,1) or for the entire data row is:- cells(c+1,1).resize(,12)

  2. #12
    New Member
    Join Date
    Aug 2019
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Consolidate rows with a macro based on lack of value in certain columns

    Something about that isn’t working for me. Would c+1 be dependent on where the consolidated row gets placed? Sometimes the formatting ends up on the totals row but sometimes it ends up two rows below the consolidated row but above the totals row still.

  3. #13
    MrExcel MVP
    Join Date
    Jan 2008
    Posts
    14,834
    Post Thanks / Like
    Mentioned
    26 Post(s)
    Tagged
    12 Thread(s)

    Default Re: Consolidate rows with a macro based on lack of value in certain columns

    Not really, the value of "c" at the end of the code would equate to the last row of data in the array "Ray", but remember the data is placed, starting in row 4 , so you would have to add 4 to get the actual last "row +1"

    Maybe:-
    Try this at the bottom of the code to get the last row of data in column "A" + one row
    The
    Code:
    Dim Lst as long
    Lst = Range("A" & Rows.Count).end(xlup).row+1
    Last edited by MickG; Aug 17th, 2019 at 05:31 AM.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •