PDA

View Full Version : Shift up data according to group ID



halimi1306
08-25-2011, 12:18 AM
Hi,

I've stuck with my problem. I would like to cleanups empty cell above my data. Currently the data is like build down waterfall, andI want to rearrange it to the same row. Data will arrange according to their Group ID in Column D and Sub Group ID in column F. The following group will fall after last column of previus group.

Attached herewith is my ws which is contains more than 3K rows. Hopefully someone here can help me up. I really appreciate if u guys can solve my problem.

Thank you very much.

halimi1306
08-25-2011, 12:34 AM
Attached is the sample of output will looks like

Bob Phillips
08-25-2011, 01:11 AM
Public Sub TidyUp()
Dim Lastcol As Long
Dim i As Long

With ActiveSheet

Lastcol = .Cells(3, .Columns.Count).End(xlToLeft).Column
For i = 4 To Lastcol

Do While .Cells(5, i).Value = ""

.Cells(5, i).Delete shift:=xlShiftUp
Loop
Next i
End With
End Sub

halimi1306
08-25-2011, 02:38 AM
Hi Bob,

Thanks for your help. Really appreciate it. However the code is running like never end, and also data in the table get lost. Maybe u can try with my attachment here.