If you have one row of data, what's the easie

Closed
usha - Feb 24, 2010 at 03:06 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Feb 24, 2010 at 05:45 AM
Hello,
If you have one row of data, what's the easiest way to automatically
(programatically?) two value in same other cell. The resulting column should consist of:

1st cell and 2nd cell
3rd cell and 4th cell
5th cell and 6th cell
etc.

For example,
1
a
2
b
3
c

would become:

1a
2b
3c

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Feb 24, 2010 at 04:28 AM
You can use formula and auto filter combo to delete the rows
or you can use this macro

Sub fixAndDeleteAlternateRow()

    Dim startAtRow, endAtRow, rowCounter As Long
    
    startAtRow = 2
    endAtRow = 100
    
    
    For rowCounter = startAtRow To endAtRow
        Cells(rowCounter - 1, 1) = Cells(rowCounter - 1, 1) & Cells(rowCounter, 1)
        Rows(rowCounter).Select
        Selection.Delete Shift:=xlUp
    Next

End Sub
0
hi ,
thanks but if i have use this macro run time error 28 is coming plz help.
0
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766 > usha
Feb 24, 2010 at 05:45 AM
I dont get any error. What line blow up? I think 28 error had to do with out of memory or stack or some thing like that. Put your sample file along with macro at some share site https://authentification.site
0