I'm still confused.
Say you start with this:
A B C D E
Bill 1 2
Bill 3 4 5
Bill 6 7
Sue 8
Sue 9
Bob 10 11
Bob 12 13
do you want to end up with this:
A B C D E
Bill 1 3 6 5 7
Sue 9 8
Bob 10 12 11 13
or:
A B C D E
Bill 1 2 4 5 7
Sue 9 8
Bob 10 12 11 13
If it's the first one, then use the first version (testme) of the macro.
If it's the second one, the use the 3rd version (testme3).
If it's something else, I'm more lost.
All of the routines just started at the bottom of column A and worked their way
up to the firstrow.
In testme:
If IsEmpty(.Cells(iRow, iCol)) Then
'do nothing
Else
'just move it up and overwrite anything there?
.Cells(iRow - 1, iCol).Value = .Cells(iRow, iCol).Value
End If
If the cell in the bottom row is empty, then don't do anything.
if the cell in the bottom row has something in it, then overwrite the cell
above.
In testme3:
If IsEmpty(.Cells(iRow - 1, iCol)) = False Then
'do nothing
Else
'just move it up and overwrite anything there?
.Cells(iRow - 1, iCol).Value = .Cells(iRow, iCol).Value
End If
If the cell above is not empty, then leave it alone.
If the cell above is empty, just plop the cell below into it.
(not too different, huh?)
Ricky Pang wrote:
Hi Dave,
To answer the second question:
No, I didn't want the values to be strung together within a single cell
ie, X,X,X...
Instead, I wanted to copy the last row, within the group, and paste the
values up one row. But I don't want to paste and overwrite the values.
So, the idea is to choose Paste Special instead and check the Skip
Blanks feature. This would then paste the X's, from the previous row,
onto the blank cells only. This way, I would retain the values and have
the bottom row's values add to the upper row on the blank cells only.
Thus, consolidating two rows into one.
Your Sub Testme1 didn't add up onto the blank cells. Testme 2 is for
stringing the values together. Unfortunately, not what I was looking
for. The result of Sub Testme3 didn't paste to blank cells either.
I know your macro is close. I just couldn't decipher where to make that
modification so that it'll only paste the X's onto the blank cells only?
(Then, delete the last row, loop the same name grouping, copy and paste
up one row, until all of the X's from the multiple rows are all on the
top row.)
Much appreciated, Dave.
Ricky
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
--
Dave Peterson