+ Reply to Thread
Results 1 to 5 of 5

how forrmating

  1. #1
    SunTEam
    Guest

    how forrmating

    Hey guys,
    I need some help. In Excel is possible to set a cell for number format,
    data format .. and more
    I need to check this format in macro. Do You know, how to do it?

    now i'll try to explain what i do, maybe there is another solution for
    my problems. So, i've got a worksheet and inside numbers. Some numbers
    are the prices and the rest are dimension of products. I need to
    calculate those prices for foreign exchange (dollars, euro ....) So i
    need increase the price numbers. I set the price cells to number format
    ( cells formating ) and the dimension to char type. To finish my work i
    need to recognize is the current selected cells of number formatting.
    i tryied something like that:

    IsNumeric(myCell.Value)

    but if the cells is of char formatting and inside is number - the result
    of isNumberic is "true". How can i split my numbers to numbers and text
    .... and then recognize in VB script

  2. #2
    Bob Phillips
    Guest

    Re: how forrmating

    If myCell.NumberFormat = "#,##0.00"

    or whatever your format is.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "SunTEam" <[email protected]> wrote in message
    news:[email protected]...
    > Hey guys,
    > I need some help. In Excel is possible to set a cell for number format,
    > data format .. and more
    > I need to check this format in macro. Do You know, how to do it?
    >
    > now i'll try to explain what i do, maybe there is another solution for
    > my problems. So, i've got a worksheet and inside numbers. Some numbers
    > are the prices and the rest are dimension of products. I need to
    > calculate those prices for foreign exchange (dollars, euro ....) So i
    > need increase the price numbers. I set the price cells to number format
    > ( cells formating ) and the dimension to char type. To finish my work i
    > need to recognize is the current selected cells of number formatting.
    > i tryied something like that:
    >
    > IsNumeric(myCell.Value)
    >
    > but if the cells is of char formatting and inside is number - the result
    > of isNumberic is "true". How can i split my numbers to numbers and text
    > ... and then recognize in VB script




  3. #3
    SunTEam
    Guest

    Re: how forrmating

    Bob Phillips napisał(a):
    > If myCell.NumberFormat = "#,##0.00"
    >
    > or whatever your format is.
    >


    Thank for help, but i cannot resolve my problem yet
    Now i'im trying something like that

    For Each myCells In mrange
    If myCells.NumberFormat = "#,##0.00" Then
    If myCells.Value <> 0 Then
    myCells.Value = myCells.Value * some
    End If
    End If
    Next

    ... and no one number is changed :-(

    dimension numbers are like : 80
    prices number are like: 30.00

    can you help me more?


  4. #4
    SunTEam
    Guest

    Re: how forrmating

    SunTEam napisał(a):
    > Bob Phillips napisał(a):
    >
    >> If myCell.NumberFormat = "#,##0.00"
    >>


    ok .now its' working
    i changed "#,##0.00" to "0.00"

  5. #5
    Bob Phillips
    Guest

    Re: how forrmating

    I would also put an Isnumeric test in there, just in case.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "SunTEam" <[email protected]> wrote in message
    news:[email protected]...
    > SunTEam napisał(a):
    > > Bob Phillips napisał(a):
    > >
    > >> If myCell.NumberFormat = "#,##0.00"
    > >>

    >
    > ok .now its' working
    > i changed "#,##0.00" to "0.00"




+ 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