Move cells up

G

gwc

How can I move the cells beginning with "0000000", "028", and "0PAID STATUS" onto the same row as the preceding cell beginning with "0ASMNT-NBR"? (Note: the number of cells beginning with "028" varies).

0ASMNT-NBR 050607227-9
0000000
0PAID STATUS
0ASMNT-NBR 050607489-9
0000000
0PAID STATUS
0ASMNT-NBR 050607522-5
0000000
0PAID STATUS
0ASMNT-NBR 050607657-4
0000000
0PAID STATUS
0ASMNT-NBR 050607749-4
0000000
0PAID STATUS
0ASMNT-NBR 050607801-7
0000000
0PAID STATUS
0ASMNT-NBR 050607842-4
0000000
02844831
0PAID STATUS
0ASMNT-NBR 050608520-6
0000000
0285275
0PAID STATUS
0ASMNT-NBR 050608546-0
0000000
0PAID STATUS
0ASMNT-NBR 050608547-1
0000000
0PAID STATUS
0ASMNT-NBR 050608548-2
0000000
0PAID STATUS
0ASMNT-NBR 050608555-8
0000000
0PAID STATUS
0ASMNT-NBR 050608605-0
0000000
0PAID STATUS
0ASMNT-NBR 050608618-2
0000000
0PAID STATUS
0ASMNT-NBR 050608706-8
0000000
02844831
0PAID STATUS
0ASMNT-NBR 050608739-8
0000000
02844831
0PAID STATUS
0ASMNT-NBR 050608750-7
0000000
02844831
0PAID STATUS
0ASMNT-NBR 050608757-4
0000000
02844831
0PAID STATUS
0ASMNT-NBR 050608762-8
0000000
02844831
0PAID STATUS
0ASMNT-NBR 050609462-0
0000000
0285291
0PAID STATUS
0ASMNT-NBR 050609482-8
0000000
0PAID STATUS
0ASMNT-NBR 050609658-1
0000000
0PAID STATUS
0ASMNT-NBR 050609754-4
0000000
0PAID STATUS
0ASMNT-NBR 050610381-4
0000000
0PAID STATUS
0ASMNT-NBR 050610456-9
0000000
0PAID STATUS
 
C

Claus Busch

Hi,

Am Mon, 12 Nov 2012 12:09:07 -0800 (PST) schrieb gwc:
How can I move the cells beginning with "0000000", "028", and "0PAID STATUS" onto the same row as the preceding cell beginning with "0ASMNT-NBR"? (Note: the number of cells beginning with "028" varies).

try:

Sub Transpose()
Dim rngC As Range
Dim Start As Long
Dim i As Integer
Dim LRow As Long

Application.ScreenUpdating = False
LRow = Cells(Rows.Count, 1).End(xlUp).Row
For Each rngC In Range("A1:A" & LRow)
If InStr(rngC, "0ASM") = 1 Then
Start = rngC.Row
i = 1
End If
If InStr(rngC, "0ASM") = 0 Then
i = i + 1
Cells(Start, i) = rngC
End If
Next
For i = LRow To 2 Step -1
If Cells(i, 2) = "" Then
Cells(i, 2).EntireRow.Delete
End If
Next
Application.ScreenUpdating = True
End Sub


Regards
Claus Busch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Move cells up 0
Aligning related data 3
Repeating cells 1
Repeat data 1
Move cells down 4
Transposing 2
Time Calculations Help 5
Counting text within an Entire Workbook 5

Top