Flipping a cell content in Excel 2007

blackystrat

New Member
Joined
Aug 5, 2014
Messages
26
Hello

How can I flip the content of a cell in Excel 2007

For example:-

I want to have Trim Motors : Electrical System : Honda Outboard as Honda Outboard : Electrical System : Trim Motors

I have thousands of cells with data in this order that I need to reverse/ flip.

Please advise

Thanks a lot
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
you could do it with a formula, but a UDF makes it much easier


Code:
Function REVERSE_CELL(strIn As String, _
                        Delim As String) As String
    Dim Ndx As Long, A As Variant, strOut As String
    A = Split(strIn, Delim)
    For Ndx = UBound(A) To LBound(A) Step -1
        strOut = strOut & A(Ndx) & Delim
    Next Ndx
    REVERSE_CELL = Left(strOut, Len(strOut) - Len(Delim))
End Function
<b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #BBB"><thead><tr style=" background-color: #DAE7F5;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">B1</th><td style="text-align:left">=REVERSE_CELL(<font color="Blue">A1," : "</font>)</td></tr></tbody></table></td></tr></table><br />



Excel 2013
AB
1Trim Motors : Electrical System : Honda OutboardHonda Outboard : Electrical System : Trim Motors
Sheet1
 
Upvote 0
Thanks for the help but it's not working.

I tried it but it's giving a #NAME? error

FYI, I am trying this on Excel 2007, not sure if that matters.

Please advise
 
Upvote 0
before applying the formula on the worksheet, you need to press ALT+F11, you will see VB editor, at the top you will see INSERT, choose INSERT MODULE, paste my code in there then go back to excel and apply the formula again
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top