2

Is it technically possible to flip numbers from all cells in a column without a plugin ?

For example, a two column spreadsheet with

Ref, Weight
3300, 500
3200, 500

Would become

Ref, Weight
0033, 500
0023, 500
1
  • @BenN 3200 reversed is 0023 as per his example
    – DavidPostill
    Mar 28, 2016 at 7:18

1 Answer 1

1

Select the cells you wish to process and run this short macro:

Sub flipper()
    Dim r As Range, s As String

    For Each r In Selection
        r.NumberFormat = "@"
        r.Value = StrReverse(r.Text)
    Next r
End Sub

Macros are very easy to install and use:

  1. ALT-F11 brings up the VBE window
  2. ALT-I ALT-M opens a fresh module
  3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it. If you are using a version of Excel later then 2003, you must save the file as .xlsm rather than .xlsx

To remove the macro:

  1. bring up the VBE window as above
  2. clear the code out
  3. close the VBE window

To use the macro from Excel:

  1. ALT-F8
  2. Select the macro
  3. Touch RUN

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

and

http://msdn.microsoft.com/en-us/library/ee814735(v=office.14).aspx

Macros must be enabled for this to work!

EDIT#1:

If you wish to avoid macros and the cells contain only digits and you are willing to use a "helper column", then with digits in column A, in C1 enter:

=TEXT(SUMPRODUCT(MID(A1,ROW(INDIRECT("1:" & LEN(A1))),1)*10^(ROW(INDIRECT("1:" & LEN(A1)))-1)),REPT("0",LEN(A1)))

and copy down: enter image description here

From T. Valko's response

3
  • Looks promising, testing this now !
    – Zulgrib
    Mar 29, 2016 at 12:07
  • Poor pentium anniversary CPU took a big headshot in term of CPU usage, but it works as expected used multiple cores, very efficient, thank you very much ! (Tested the VBE solution)
    – Zulgrib
    Mar 29, 2016 at 12:17
  • @Zulgrib .................Glad to Help.............. Mar 29, 2016 at 12:18

Not the answer you're looking for? Browse other questions tagged .