ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Move cells down (https://www.excelbanter.com/excel-programming/445156-move-cells-down.html)

gary

Move cells down
 
My spreadsheet has:

G T
001504798-2 001504798-2 xoxoxox
001511777-5 001511777-5 485505
001511905-4 001511905-4 48304550
001512678-2 001512678-2 yyyyyyy
001512678-2 001512697-9 zzzzzz
001512678-2 001513196-6
001512678-2 001513504-1 dododod
001512678-2 001513842-6
001512697-9 001514491-5 $$%^&
001512697-9 001514725-7
001512697-9 001515239-8
001512697-9
001513196-6
001513504-1
001513504-1
001513504-1
001513842-6
001514491-5
001514491-5
001514491-5
001514491-5
001514491-5
001514725-7
001514725-7
001514725-7
001514725-7
001514725-7
001515239-8
001515239-8
001515239-8
001515239-8
001515239-8
001515312-0

Note: The cells in T may have more than 11 characters but I want to
match on the 11 leftmost characters.



How can I move the cells in COL T down until they are on the same row
as the matching cells in COL G so the result is:

G T
001504798-2 001504798-2 xoxoxox
001511777-5 001511777-5 485505
001511905-4 001511905-4 48304550
001512678-2 001512678-2 yyyyyyy
001512678-2
001512678-2
001512678-2
001512678-2
001512697-9 001512697-9 zzzzzz
001512697-9
001512697-9
001512697-9
001513196-6 001513196-6
001513504-1 001513504-1 dododod
001513504-1
001513504-1
001513842-6 001513842-6
001514491-5 001514491-5 $$%^&
001514491-5
001514491-5
001514491-5
001514491-5
001514725-7 001514725-7
001514725-7
001514725-7
001514725-7
001514725-7
001515239-8 001515239-8
001515239-8
001515239-8
001515239-8
001515239-8




Ron Rosenfeld[_2_]

Move cells down
 
On Wed, 30 Nov 2011 10:55:20 -0800 (PST), gary wrote:

My spreadsheet has:

G T
001504798-2 001504798-2 xoxoxox
001511777-5 001511777-5 485505
001511905-4 001511905-4 48304550
001512678-2 001512678-2 yyyyyyy
001512678-2 001512697-9 zzzzzz
001512678-2 001513196-6
001512678-2 001513504-1 dododod
001512678-2 001513842-6
001512697-9 001514491-5 $$%^&
001512697-9 001514725-7
001512697-9 001515239-8
001512697-9
001513196-6
001513504-1
001513504-1
001513504-1
001513842-6
001514491-5
001514491-5
001514491-5
001514491-5
001514491-5
001514725-7
001514725-7
001514725-7
001514725-7
001514725-7
001515239-8
001515239-8
001515239-8
001515239-8
001515239-8
001515312-0

Note: The cells in T may have more than 11 characters but I want to
match on the 11 leftmost characters.



How can I move the cells in COL T down until they are on the same row
as the matching cells in COL G so the result is:

G T
001504798-2 001504798-2 xoxoxox
001511777-5 001511777-5 485505
001511905-4 001511905-4 48304550
001512678-2 001512678-2 yyyyyyy
001512678-2
001512678-2
001512678-2
001512678-2
001512697-9 001512697-9 zzzzzz
001512697-9
001512697-9
001512697-9
001513196-6 001513196-6
001513504-1 001513504-1 dododod
001513504-1
001513504-1
001513842-6 001513842-6
001514491-5 001514491-5 $$%^&
001514491-5
001514491-5
001514491-5
001514491-5
001514725-7 001514725-7
001514725-7
001514725-7
001514725-7
001514725-7
001515239-8 001515239-8
001515239-8
001515239-8
001515239-8
001515239-8



Is it the case that column T may contain either one or two substrings? Or is the third apparent column of strings in a separate column?

Is it the case that you do NOT want columns H:S altered?

Don Guillett[_2_]

Move cells down
 
I answered this in another forum VERY recently

Sub moveemdowntomatchSAS()
Dim i As Long
For i = 2 To Cells(Rows.Count, "a").End(xlUp).Row
If Left(Cells(i, "a"), 11) < Left(Cells(i, "b"), 11) Then
Cells(i, "b").Resize(, 2).Insert
End If
Next i
End Sub


On Nov 30, 12:55*pm, gary wrote:
My spreadsheet has:

* * * * *G * * * * * * * * * * * * * *T
001504798-2 *001504798-2 *xoxoxox
001511777-5 *001511777-5 *485505
001511905-4 *001511905-4 *48304550
001512678-2 *001512678-2 *yyyyyyy
001512678-2 *001512697-9 *zzzzzz
001512678-2 *001513196-6
001512678-2 *001513504-1 *dododod
001512678-2 *001513842-6
001512697-9 *001514491-5 *$$%^&
001512697-9 *001514725-7
001512697-9 *001515239-8
001512697-9
001513196-6
001513504-1
001513504-1
001513504-1
001513842-6
001514491-5
001514491-5
001514491-5
001514491-5
001514491-5
001514725-7
001514725-7
001514725-7
001514725-7
001514725-7
001515239-8
001515239-8
001515239-8
001515239-8
001515239-8
001515312-0

Note: The cells in T may have more than 11 characters but I want to
match on the 11 leftmost characters.

How can I move the cells in COL T down until they are on the same row
as the matching cells in COL G so the result is:

* * * * * G * * * * * * * * * * * * T
001504798-2 *001504798-2 *xoxoxox
001511777-5 *001511777-5 *485505
001511905-4 *001511905-4 *48304550
001512678-2 *001512678-2 *yyyyyyy
001512678-2
001512678-2
001512678-2
001512678-2
001512697-9 *001512697-9 *zzzzzz
001512697-9
001512697-9
001512697-9
001513196-6 *001513196-6
001513504-1 *001513504-1 *dododod
001513504-1
001513504-1
001513842-6 *001513842-6
001514491-5 *001514491-5 *$$%^&
001514491-5
001514491-5
001514491-5
001514491-5
001514725-7 *001514725-7
001514725-7
001514725-7
001514725-7
001514725-7
001515239-8 *001515239-8
001515239-8
001515239-8
001515239-8
001515239-8




All times are GMT +1. The time now is 01:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com