H
Hans Hamm
Ben
I set a breakpoint so I could see the data coming from Sheet 2 Column C and being pasted into the new sheet. Each variation is copying and pasting the blank cell.
How would I do something like this; If rpaste.Offset(y,0).Value <>"" thenrPaste.Offset(y, 0).Value = rCopy2.Cells(x, 1)
I tried this and did not get it to work... to me it seems like it would.
Another idea I had was to sort the data in the new worksheet right after the paste... used part of your code to come up with this
With wsNew
wsNew.Sort
.SortFields.Clear
.SortFields.Add Key:=Range("G" & lFirstRow & ":G" & lLastRow) _
, SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
.SetRange ("G" & lFirstRow & ":G" & lLastRow)
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
But it gives me a compile error: invalid use of property on the .Sort (justafter the wsNew