+ Reply to Thread
Results 1 to 3 of 3

Consistent formatting en masse (dates, percentages, numbers glitch)

Hybrid View

  1. #1
    Registered User
    Join Date
    01-13-2013
    Location
    illinois
    MS-Off Ver
    Excel 2003
    Posts
    1

    Consistent formatting en masse (dates, percentages, numbers glitch)

    I have a spreadsheet with a mix of data formatting I’m trying to make consistent. I’m trying to show percentage ranges like this: 0, 1-5, 6-25, 26-50, 51-75, 76-100. Half my spreadsheet is set up like this, but the other half was set up like this: A (0), B (1-5), C (6-25), D (26-50), E (51-75), F (76-100). To make them all consistent, I have done the following:

    1 – I converted all the letters to their corresponding percentage ranges using Find/Replace (Find/Replace all the ‘A’s with ‘0;’ Find/Replace all the ‘B’s with ‘1-5,’ and so on) – FAIL: The only way that would work is if I added the % symbol to the end of each range, so I was left with half my cells saying 1-5, 6-25, etc. and half my cells showing 1-5%, 6-25%.

    2 – To get rid of the % symbol, I went through and Find/Replaced ‘%’ with ‘(nothing)’ – FAIL: that changed all the ranges back to dates.

    3 – I selected all and hit format cells. I tried general, number, text, all to no avail.

    4 – Then I copy/pasted all the cells into a Word and Notepad document, removed the formatting and Paste Special  text only back into Excel. That just auto-converted it back to dates again.

    5 – Then I tried Find/Replace with what was showing up in the cells (5-Jan). Find/Replace ‘5-Jan’ with ‘1-5.’ Excel then says it doesn’t recognize any instances.

    6 – Then I looked at what was actually in the cells and tried Find/Replace that way. Find/Replace ‘1/5/2013’ with ‘1-5.’ Then Excel says it’s made all the changes but nothing changes.

    I’m out of ideas
    Attached Files Attached Files

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Consistent formatting en masse (dates, percentages, numbers glitch)

    First format all your cells as text. Select - right click - cell format - text.

    Paste the following into a new module in the VBA editor (Alt F11)

    Sub Test()
    For Each Cell In Selection
        If InStr(Cell.Value, "%") > 0 Then
            Cell.Value = Application.Substitute(Cell.Value, "%", "")
        End If
    Next Cell
    End Sub
    Select the cells that you want to change and run the macro.


    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Open up the VBA editor by hitting ALT F11

    Insert a new module by hitting Insert - Module

    Paste the macro into the empty sheet

    Hit ALT F11 to get back to the worksheet.

    Run the macro by going to tools-macro in Excel 2003 or the view ribbon in Excel 2007/2010.
    Martin

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Consistent formatting en masse (dates, percentages, numbers glitch)

    Not sure I understand what your problem is? when I extract unique entries from all columns, I get...
    0
    1-5
    6-25
    ?
    26-50
    51-75
    76-100
    DRIED UP - NO SAMPLE
    too turbid to tell
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1