+ Reply to Thread
Results 1 to 8 of 8

Minus sign at the end of number

  1. #1
    Registered User
    Join Date
    07-22-2009
    Location
    Quebec
    MS-Off Ver
    Excel 2007
    Posts
    11

    Minus sign at the end of number

    I am exporting data from a software to excel. But I have a problem since all the negative number are written with the negative at the end of the number instead of the beginning (don't ask me why). So what I would like to do is a find and replace to find any number that has a minus sign at the end and put the minus sign at the beginning. Is there any way to do so. By the way, the numbers can be anywhere from A1 to BG20677. So I can't make a macro that go cells by cells to see if there is a minus sign.

    Thanks a lot,

    Cope

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Minus sign at the end of number

    Have you tried just adjusting the cell formatting? It might just be custom format which you could change in one fell swoop.

  3. #3
    Registered User
    Join Date
    07-22-2009
    Location
    Quebec
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Minus sign at the end of number

    I took a look at what you said and I could take a number with a minus sign at the beginning and put it at the end, but I can't make the opposite since excel does not recognize my negative numbers as numbers.

    Thanks for your help, if you have any other ideas please let me know,

    Cope

  4. #4
    Forum Contributor
    Join Date
    02-23-2006
    Location
    Near London, England
    MS-Off Ver
    Office 2003
    Posts
    770

    Re: Minus sign at the end of number

    The following macro will do what you want I hope

    Please Login or Register  to view this content.
    Last edited by Phil_V; 07-22-2009 at 11:37 AM. Reason: Comments and MsgBox added to code
    If you find the response helpful please click the scales in the blue bar above and rate it
    If you don't like the response, don't bother with the scales, they are not for you

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Minus sign at the end of number

    Here's another way:
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Forum Contributor
    Join Date
    02-23-2006
    Location
    Near London, England
    MS-Off Ver
    Office 2003
    Posts
    770

    Re: Minus sign at the end of number

    @shg

    Ooo - thats snazzy, I wasn't aware of that function

    Note though that it will cause a problem if a cell contains a value such as "-Note: This cell starts with a dash".

    Of course to enter that text you have to start it with a single quote ' , then Excel accepts that as text and not a formula, but your macro seems to break that when it runs.

    Not sure if thats a problem or not for the OP, but thought I'd better point it out

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Minus sign at the end of number

    it will cause a problem if a cell contains a value such as "-Note:
    It's a fair wind that blows no ill ...

  8. #8
    Registered User
    Join Date
    07-22-2009
    Location
    Quebec
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Minus sign at the end of number

    Thanks a lot, the the macro sent by Phil_V worked out great for me. I haven't try the other ones but thanks a lot to all of you.

    Cope

+ 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