Closed Thread
Results 1 to 3 of 3

Mutliplying text and number values Macro with mutliple conditions

  1. #1
    Registered User
    Join Date
    04-24-2007
    Location
    South Florida
    Posts
    1

    Mutliplying text and number values Macro with mutliple conditions

    I need a Macro to multiply text and numbers by 1,000. Here are the caveats. The text or numbers will appear as the following. There is a comma instead of a period because we are working with Latin American data and they're usage of commas and periods are different that ours.

    "<5,00123"
    "< 5,00123"
    "5,00123 J"
    5.000123 - this will appear as "5,000123" however that is only because it is formatted that way, the Excel value is still 5.000123

    The values above after multiplied by 1000 should equal the following:
    "<5.000,123"
    "< 5.000,123"
    "5.000,123 J"
    5,000.123 - this will need to stay in number format and we could could simply change the format to match the Latin American comma period foramatting.

    We also place "NA" or "Nor Sampled" or some other text in the cell. These would have to be returned as the same text.

    Also, in the case of the following:

    "<0.098"
    should equal
    "<98" and not include all the excess 0's at the end.

    and
    "<9.8" should equal
    "<9.800" and not include all the excess 0's.

    Ideally, I would like to hightlight all the cells that need to be changed and then run a macro that would perform the operation in place. This would be much easier than a UDF.

    Thank you in advance,

    Anthony

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    antimel,

    Please see forum rules below

    This thread will be closed for cross posting without adding the links


    VBA Noob
    Last edited by VBA Noob; 04-24-2007 at 05:31 PM.
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Contributor
    Join Date
    12-12-2006
    Location
    New Zealand
    Posts
    151
    Please note

    Cross Post MrExcel

    And Here at ozgrid

Closed 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