+ Reply to Thread
Results 1 to 41 of 41

How do I change the format of a cell based on what I input?

  1. #1
    RagDyer
    Guest

    Re: How do I change the format of a cell based on what I input?

    Appreciate the feed-back.
    --
    Regards,

    RD
    ==============================================
    Please keep all correspondence within the Group, so all may benefit!
    ==============================================


    "Husker87" <[email protected]> wrote in message
    news:[email protected]...
    > Perfect . Thanks Much. Have a good weekend.
    >
    > "RagDyeR" wrote:
    >
    > > Sorry, forgot to mention:
    > >
    > > <Tools> <Options> <Edit> tab,
    > >
    > > And *UNCHECK*
    > >
    > > "Enable Auto Percent Entry".
    > >
    > > This custom format doesn't seem to work on versions without this option
    > > (XL97).
    > > --
    > >
    > > HTH,
    > >
    > > RD
    > > =====================================================
    > > Please keep all correspondence within the Group, so all may benefit!
    > > =====================================================
    > >
    > > "Husker87" <[email protected]> wrote in message
    > > news:[email protected]...
    > > Works well with the number less than 1 but maybe I'm doing something
    > > wrong...
    > > it doesn't want to take numbers greater than 1 without the % sign. I

    tryed
    > > 14 and it comes up "14.0%" Any ideas? Thanks for lookng at it....
    > >
    > > "RagDyer" wrote:
    > >
    > > > You can try this custom format:
    > > >
    > > > [>=1]#,###.00;[<1]#.0%;Genera*l
    > > >
    > > > --
    > > > HTH,
    > > >
    > > > RD
    > > > ==============================================
    > > > Please keep all correspondence within the Group, so all may benefit!
    > > > ==============================================
    > > >
    > > >
    > > > "Husker87" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > OK... here's the question. I have a cell that I input a number

    into.
    > > If
    > > > I
    > > > > input a number less than 1, I want the cell to be formated with a
    > > > percentage
    > > > > sign. If I input a number greater than 1, I want it to show just as

    a
    > > > number
    > > > > (with no percentage sign).
    > > > >
    > > > > I would prefer the answer NOT include a macro as this worksheet will

    be
    > > > used
    > > > > on older computers that have a hard time running macros. If it

    can't be
    > > > done
    > > > > without a macro then a macro will be OK. Any thoughts? and thanks

    very
    > > > > much....
    > > >
    > > >

    > >
    > >
    > >



  2. #2
    Husker87
    Guest

    Re: How do I change the format of a cell based on what I input?

    Perfect . Thanks Much. Have a good weekend.

    "RagDyeR" wrote:

    > Sorry, forgot to mention:
    >
    > <Tools> <Options> <Edit> tab,
    >
    > And *UNCHECK*
    >
    > "Enable Auto Percent Entry".
    >
    > This custom format doesn't seem to work on versions without this option
    > (XL97).
    > --
    >
    > HTH,
    >
    > RD
    > =====================================================
    > Please keep all correspondence within the Group, so all may benefit!
    > =====================================================
    >
    > "Husker87" <[email protected]> wrote in message
    > news:[email protected]...
    > Works well with the number less than 1 but maybe I'm doing something
    > wrong...
    > it doesn't want to take numbers greater than 1 without the % sign. I tryed
    > 14 and it comes up "14.0%" Any ideas? Thanks for lookng at it....
    >
    > "RagDyer" wrote:
    >
    > > You can try this custom format:
    > >
    > > [>=1]#,###.00;[<1]#.0%;GeneraÂ*l
    > >
    > > --
    > > HTH,
    > >
    > > RD
    > > ==============================================
    > > Please keep all correspondence within the Group, so all may benefit!
    > > ==============================================
    > >
    > >
    > > "Husker87" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > OK... here's the question. I have a cell that I input a number into.

    > If
    > > I
    > > > input a number less than 1, I want the cell to be formated with a

    > > percentage
    > > > sign. If I input a number greater than 1, I want it to show just as a

    > > number
    > > > (with no percentage sign).
    > > >
    > > > I would prefer the answer NOT include a macro as this worksheet will be

    > > used
    > > > on older computers that have a hard time running macros. If it can't be

    > > done
    > > > without a macro then a macro will be OK. Any thoughts? and thanks very
    > > > much....

    > >
    > >

    >
    >
    >


  3. #3
    RagDyeR
    Guest

    Re: How do I change the format of a cell based on what I input?

    Sorry, forgot to mention:

    <Tools> <Options> <Edit> tab,

    And *UNCHECK*

    "Enable Auto Percent Entry".

    This custom format doesn't seem to work on versions without this option
    (XL97).
    --

    HTH,

    RD
    =====================================================
    Please keep all correspondence within the Group, so all may benefit!
    =====================================================

    "Husker87" <[email protected]> wrote in message
    news:[email protected]...
    Works well with the number less than 1 but maybe I'm doing something
    wrong...
    it doesn't want to take numbers greater than 1 without the % sign. I tryed
    14 and it comes up "14.0%" Any ideas? Thanks for lookng at it....

    "RagDyer" wrote:

    > You can try this custom format:
    >
    > [>=1]#,###.00;[<1]#.0%;Genera*l
    >
    > --
    > HTH,
    >
    > RD
    > ==============================================
    > Please keep all correspondence within the Group, so all may benefit!
    > ==============================================
    >
    >
    > "Husker87" <[email protected]> wrote in message
    > news:[email protected]...
    > > OK... here's the question. I have a cell that I input a number into.

    If
    > I
    > > input a number less than 1, I want the cell to be formated with a

    > percentage
    > > sign. If I input a number greater than 1, I want it to show just as a

    > number
    > > (with no percentage sign).
    > >
    > > I would prefer the answer NOT include a macro as this worksheet will be

    > used
    > > on older computers that have a hard time running macros. If it can't be

    > done
    > > without a macro then a macro will be OK. Any thoughts? and thanks very
    > > much....

    >
    >




  4. #4
    Bob Phillips
    Guest

    Re: How do I change the format of a cell based on what I input?

    Conditional formatting won't affect the numberformat so you need code

    Private Sub Worksheet_Change(ByVal Target As Range)
    Const WS_RANGE As String = "H1:H10"

    On Error GoTo ws_exit:
    Application.EnableEvents = False
    If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
    With Target
    If .Value < 1 Then
    .NumberFormat = "0%"
    Else
    .NumberFormat = "General"
    End If
    End With
    End If

    ws_exit:
    Application.EnableEvents = True
    End Sub

    'This is worksheet event code, which means that it needs to be
    'placed in the appropriate worksheet code module, not a standard
    'code module. To do this, right-click on the sheet tab, select
    'the View Code option from the menu, and paste the code in.

    --

    HTH

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


    "Husker87" <[email protected]> wrote in message
    news:[email protected]...
    > OK... here's the question. I have a cell that I input a number into. If

    I
    > input a number less than 1, I want the cell to be formated with a

    percentage
    > sign. If I input a number greater than 1, I want it to show just as a

    number
    > (with no percentage sign).
    >
    > I would prefer the answer NOT include a macro as this worksheet will be

    used
    > on older computers that have a hard time running macros. If it can't be

    done
    > without a macro then a macro will be OK. Any thoughts? and thanks very
    > much....




  5. #5
    RagDyer
    Guest

    Re: How do I change the format of a cell based on what I input?

    You can try this custom format:

    [>=1]#,###.00;[<1]#.0%;GeneraÂ*l

    --
    HTH,

    RD
    ==============================================
    Please keep all correspondence within the Group, so all may benefit!
    ==============================================


    "Husker87" <[email protected]> wrote in message
    news:[email protected]...
    > OK... here's the question. I have a cell that I input a number into. If

    I
    > input a number less than 1, I want the cell to be formated with a

    percentage
    > sign. If I input a number greater than 1, I want it to show just as a

    number
    > (with no percentage sign).
    >
    > I would prefer the answer NOT include a macro as this worksheet will be

    used
    > on older computers that have a hard time running macros. If it can't be

    done
    > without a macro then a macro will be OK. Any thoughts? and thanks very
    > much....



  6. #6
    Temp
    Guest

    Re: How do I change the format of a cell based on what I input?

    Put your number in cell A1 then this formula in cell B1:

    =TEXT(A1,"#,###"&IF(A1<1,"%",""))


  7. #7
    Husker87
    Guest

    Re: How do I change the format of a cell based on what I input?

    Works well with the number less than 1 but maybe I'm doing something wrong...
    it doesn't want to take numbers greater than 1 without the % sign. I tryed
    14 and it comes up "14.0%" Any ideas? Thanks for lookng at it....

    "RagDyer" wrote:

    > You can try this custom format:
    >
    > [>=1]#,###.00;[<1]#.0%;GeneraÂ*l
    >
    > --
    > HTH,
    >
    > RD
    > ==============================================
    > Please keep all correspondence within the Group, so all may benefit!
    > ==============================================
    >
    >
    > "Husker87" <[email protected]> wrote in message
    > news:[email protected]...
    > > OK... here's the question. I have a cell that I input a number into. If

    > I
    > > input a number less than 1, I want the cell to be formated with a

    > percentage
    > > sign. If I input a number greater than 1, I want it to show just as a

    > number
    > > (with no percentage sign).
    > >
    > > I would prefer the answer NOT include a macro as this worksheet will be

    > used
    > > on older computers that have a hard time running macros. If it can't be

    > done
    > > without a macro then a macro will be OK. Any thoughts? and thanks very
    > > much....

    >
    >


  8. #8
    Husker87
    Guest

    Re: How do I change the format of a cell based on what I input?

    Thanks Bob... work well. One question... when you enter a number greater
    than 1 in a cell that previously had a number less than 1 (with a percentage
    sign) it automatically moves the decimal over two spaces... (1,200 shows up
    as 12.00) then when you enter it again it enters it appears correctly.
    (1,200 is 1,200) Anyway to make it so you can go smoothly back and forth
    between the percent sign and a number greater than one?

    "Bob Phillips" wrote:

    > Conditional formatting won't affect the numberformat so you need code
    >
    > Private Sub Worksheet_Change(ByVal Target As Range)
    > Const WS_RANGE As String = "H1:H10"
    >
    > On Error GoTo ws_exit:
    > Application.EnableEvents = False
    > If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
    > With Target
    > If .Value < 1 Then
    > .NumberFormat = "0%"
    > Else
    > .NumberFormat = "General"
    > End If
    > End With
    > End If
    >
    > ws_exit:
    > Application.EnableEvents = True
    > End Sub
    >
    > 'This is worksheet event code, which means that it needs to be
    > 'placed in the appropriate worksheet code module, not a standard
    > 'code module. To do this, right-click on the sheet tab, select
    > 'the View Code option from the menu, and paste the code in.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Husker87" <[email protected]> wrote in message
    > news:[email protected]...
    > > OK... here's the question. I have a cell that I input a number into. If

    > I
    > > input a number less than 1, I want the cell to be formated with a

    > percentage
    > > sign. If I input a number greater than 1, I want it to show just as a

    > number
    > > (with no percentage sign).
    > >
    > > I would prefer the answer NOT include a macro as this worksheet will be

    > used
    > > on older computers that have a hard time running macros. If it can't be

    > done
    > > without a macro then a macro will be OK. Any thoughts? and thanks very
    > > much....

    >
    >
    >


  9. #9
    RagDyer
    Guest

    Re: How do I change the format of a cell based on what I input?

    Appreciate the feed-back.
    --
    Regards,

    RD
    ==============================================
    Please keep all correspondence within the Group, so all may benefit!
    ==============================================


    "Husker87" <[email protected]> wrote in message
    news:[email protected]...
    > Perfect . Thanks Much. Have a good weekend.
    >
    > "RagDyeR" wrote:
    >
    > > Sorry, forgot to mention:
    > >
    > > <Tools> <Options> <Edit> tab,
    > >
    > > And *UNCHECK*
    > >
    > > "Enable Auto Percent Entry".
    > >
    > > This custom format doesn't seem to work on versions without this option
    > > (XL97).
    > > --
    > >
    > > HTH,
    > >
    > > RD
    > > =====================================================
    > > Please keep all correspondence within the Group, so all may benefit!
    > > =====================================================
    > >
    > > "Husker87" <[email protected]> wrote in message
    > > news:[email protected]...
    > > Works well with the number less than 1 but maybe I'm doing something
    > > wrong...
    > > it doesn't want to take numbers greater than 1 without the % sign. I

    tryed
    > > 14 and it comes up "14.0%" Any ideas? Thanks for lookng at it....
    > >
    > > "RagDyer" wrote:
    > >
    > > > You can try this custom format:
    > > >
    > > > [>=1]#,###.00;[<1]#.0%;GeneraÂ*l
    > > >
    > > > --
    > > > HTH,
    > > >
    > > > RD
    > > > ==============================================
    > > > Please keep all correspondence within the Group, so all may benefit!
    > > > ==============================================
    > > >
    > > >
    > > > "Husker87" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > OK... here's the question. I have a cell that I input a number

    into.
    > > If
    > > > I
    > > > > input a number less than 1, I want the cell to be formated with a
    > > > percentage
    > > > > sign. If I input a number greater than 1, I want it to show just as

    a
    > > > number
    > > > > (with no percentage sign).
    > > > >
    > > > > I would prefer the answer NOT include a macro as this worksheet will

    be
    > > > used
    > > > > on older computers that have a hard time running macros. If it

    can't be
    > > > done
    > > > > without a macro then a macro will be OK. Any thoughts? and thanks

    very
    > > > > much....
    > > >
    > > >

    > >
    > >
    > >



  10. #10
    Husker87
    Guest

    Re: How do I change the format of a cell based on what I input?

    Perfect . Thanks Much. Have a good weekend.

    "RagDyeR" wrote:

    > Sorry, forgot to mention:
    >
    > <Tools> <Options> <Edit> tab,
    >
    > And *UNCHECK*
    >
    > "Enable Auto Percent Entry".
    >
    > This custom format doesn't seem to work on versions without this option
    > (XL97).
    > --
    >
    > HTH,
    >
    > RD
    > =====================================================
    > Please keep all correspondence within the Group, so all may benefit!
    > =====================================================
    >
    > "Husker87" <[email protected]> wrote in message
    > news:[email protected]...
    > Works well with the number less than 1 but maybe I'm doing something
    > wrong...
    > it doesn't want to take numbers greater than 1 without the % sign. I tryed
    > 14 and it comes up "14.0%" Any ideas? Thanks for lookng at it....
    >
    > "RagDyer" wrote:
    >
    > > You can try this custom format:
    > >
    > > [>=1]#,###.00;[<1]#.0%;GeneraÂ*l
    > >
    > > --
    > > HTH,
    > >
    > > RD
    > > ==============================================
    > > Please keep all correspondence within the Group, so all may benefit!
    > > ==============================================
    > >
    > >
    > > "Husker87" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > OK... here's the question. I have a cell that I input a number into.

    > If
    > > I
    > > > input a number less than 1, I want the cell to be formated with a

    > > percentage
    > > > sign. If I input a number greater than 1, I want it to show just as a

    > > number
    > > > (with no percentage sign).
    > > >
    > > > I would prefer the answer NOT include a macro as this worksheet will be

    > > used
    > > > on older computers that have a hard time running macros. If it can't be

    > > done
    > > > without a macro then a macro will be OK. Any thoughts? and thanks very
    > > > much....

    > >
    > >

    >
    >
    >


  11. #11
    RagDyeR
    Guest

    Re: How do I change the format of a cell based on what I input?

    Sorry, forgot to mention:

    <Tools> <Options> <Edit> tab,

    And *UNCHECK*

    "Enable Auto Percent Entry".

    This custom format doesn't seem to work on versions without this option
    (XL97).
    --

    HTH,

    RD
    =====================================================
    Please keep all correspondence within the Group, so all may benefit!
    =====================================================

    "Husker87" <[email protected]> wrote in message
    news:[email protected]...
    Works well with the number less than 1 but maybe I'm doing something
    wrong...
    it doesn't want to take numbers greater than 1 without the % sign. I tryed
    14 and it comes up "14.0%" Any ideas? Thanks for lookng at it....

    "RagDyer" wrote:

    > You can try this custom format:
    >
    > [>=1]#,###.00;[<1]#.0%;Genera*l
    >
    > --
    > HTH,
    >
    > RD
    > ==============================================
    > Please keep all correspondence within the Group, so all may benefit!
    > ==============================================
    >
    >
    > "Husker87" <[email protected]> wrote in message
    > news:[email protected]...
    > > OK... here's the question. I have a cell that I input a number into.

    If
    > I
    > > input a number less than 1, I want the cell to be formated with a

    > percentage
    > > sign. If I input a number greater than 1, I want it to show just as a

    > number
    > > (with no percentage sign).
    > >
    > > I would prefer the answer NOT include a macro as this worksheet will be

    > used
    > > on older computers that have a hard time running macros. If it can't be

    > done
    > > without a macro then a macro will be OK. Any thoughts? and thanks very
    > > much....

    >
    >




  12. #12
    Temp
    Guest

    Re: How do I change the format of a cell based on what I input?

    Put your number in cell A1 then this formula in cell B1:

    =TEXT(A1,"#,###"&IF(A1<1,"%",""))


  13. #13
    Husker87
    Guest

    Re: How do I change the format of a cell based on what I input?

    Works well with the number less than 1 but maybe I'm doing something wrong...
    it doesn't want to take numbers greater than 1 without the % sign. I tryed
    14 and it comes up "14.0%" Any ideas? Thanks for lookng at it....

    "RagDyer" wrote:

    > You can try this custom format:
    >
    > [>=1]#,###.00;[<1]#.0%;GeneraÂ*l
    >
    > --
    > HTH,
    >
    > RD
    > ==============================================
    > Please keep all correspondence within the Group, so all may benefit!
    > ==============================================
    >
    >
    > "Husker87" <[email protected]> wrote in message
    > news:[email protected]...
    > > OK... here's the question. I have a cell that I input a number into. If

    > I
    > > input a number less than 1, I want the cell to be formated with a

    > percentage
    > > sign. If I input a number greater than 1, I want it to show just as a

    > number
    > > (with no percentage sign).
    > >
    > > I would prefer the answer NOT include a macro as this worksheet will be

    > used
    > > on older computers that have a hard time running macros. If it can't be

    > done
    > > without a macro then a macro will be OK. Any thoughts? and thanks very
    > > much....

    >
    >


  14. #14
    Husker87
    Guest

    Re: How do I change the format of a cell based on what I input?

    Thanks Bob... work well. One question... when you enter a number greater
    than 1 in a cell that previously had a number less than 1 (with a percentage
    sign) it automatically moves the decimal over two spaces... (1,200 shows up
    as 12.00) then when you enter it again it enters it appears correctly.
    (1,200 is 1,200) Anyway to make it so you can go smoothly back and forth
    between the percent sign and a number greater than one?

    "Bob Phillips" wrote:

    > Conditional formatting won't affect the numberformat so you need code
    >
    > Private Sub Worksheet_Change(ByVal Target As Range)
    > Const WS_RANGE As String = "H1:H10"
    >
    > On Error GoTo ws_exit:
    > Application.EnableEvents = False
    > If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
    > With Target
    > If .Value < 1 Then
    > .NumberFormat = "0%"
    > Else
    > .NumberFormat = "General"
    > End If
    > End With
    > End If
    >
    > ws_exit:
    > Application.EnableEvents = True
    > End Sub
    >
    > 'This is worksheet event code, which means that it needs to be
    > 'placed in the appropriate worksheet code module, not a standard
    > 'code module. To do this, right-click on the sheet tab, select
    > 'the View Code option from the menu, and paste the code in.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Husker87" <[email protected]> wrote in message
    > news:[email protected]...
    > > OK... here's the question. I have a cell that I input a number into. If

    > I
    > > input a number less than 1, I want the cell to be formated with a

    > percentage
    > > sign. If I input a number greater than 1, I want it to show just as a

    > number
    > > (with no percentage sign).
    > >
    > > I would prefer the answer NOT include a macro as this worksheet will be

    > used
    > > on older computers that have a hard time running macros. If it can't be

    > done
    > > without a macro then a macro will be OK. Any thoughts? and thanks very
    > > much....

    >
    >
    >


  15. #15
    Bob Phillips
    Guest

    Re: How do I change the format of a cell based on what I input?

    Conditional formatting won't affect the numberformat so you need code

    Private Sub Worksheet_Change(ByVal Target As Range)
    Const WS_RANGE As String = "H1:H10"

    On Error GoTo ws_exit:
    Application.EnableEvents = False
    If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
    With Target
    If .Value < 1 Then
    .NumberFormat = "0%"
    Else
    .NumberFormat = "General"
    End If
    End With
    End If

    ws_exit:
    Application.EnableEvents = True
    End Sub

    'This is worksheet event code, which means that it needs to be
    'placed in the appropriate worksheet code module, not a standard
    'code module. To do this, right-click on the sheet tab, select
    'the View Code option from the menu, and paste the code in.

    --

    HTH

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


    "Husker87" <[email protected]> wrote in message
    news:[email protected]...
    > OK... here's the question. I have a cell that I input a number into. If

    I
    > input a number less than 1, I want the cell to be formated with a

    percentage
    > sign. If I input a number greater than 1, I want it to show just as a

    number
    > (with no percentage sign).
    >
    > I would prefer the answer NOT include a macro as this worksheet will be

    used
    > on older computers that have a hard time running macros. If it can't be

    done
    > without a macro then a macro will be OK. Any thoughts? and thanks very
    > much....




  16. #16
    RagDyer
    Guest

    Re: How do I change the format of a cell based on what I input?

    You can try this custom format:

    [>=1]#,###.00;[<1]#.0%;GeneraÂ*l

    --
    HTH,

    RD
    ==============================================
    Please keep all correspondence within the Group, so all may benefit!
    ==============================================


    "Husker87" <[email protected]> wrote in message
    news:[email protected]...
    > OK... here's the question. I have a cell that I input a number into. If

    I
    > input a number less than 1, I want the cell to be formated with a

    percentage
    > sign. If I input a number greater than 1, I want it to show just as a

    number
    > (with no percentage sign).
    >
    > I would prefer the answer NOT include a macro as this worksheet will be

    used
    > on older computers that have a hard time running macros. If it can't be

    done
    > without a macro then a macro will be OK. Any thoughts? and thanks very
    > much....



  17. #17
    Husker87
    Guest

    Re: How do I change the format of a cell based on what I input?

    Thanks Bob... work well. One question... when you enter a number greater
    than 1 in a cell that previously had a number less than 1 (with a percentage
    sign) it automatically moves the decimal over two spaces... (1,200 shows up
    as 12.00) then when you enter it again it enters it appears correctly.
    (1,200 is 1,200) Anyway to make it so you can go smoothly back and forth
    between the percent sign and a number greater than one?

    "Bob Phillips" wrote:

    > Conditional formatting won't affect the numberformat so you need code
    >
    > Private Sub Worksheet_Change(ByVal Target As Range)
    > Const WS_RANGE As String = "H1:H10"
    >
    > On Error GoTo ws_exit:
    > Application.EnableEvents = False
    > If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
    > With Target
    > If .Value < 1 Then
    > .NumberFormat = "0%"
    > Else
    > .NumberFormat = "General"
    > End If
    > End With
    > End If
    >
    > ws_exit:
    > Application.EnableEvents = True
    > End Sub
    >
    > 'This is worksheet event code, which means that it needs to be
    > 'placed in the appropriate worksheet code module, not a standard
    > 'code module. To do this, right-click on the sheet tab, select
    > 'the View Code option from the menu, and paste the code in.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Husker87" <[email protected]> wrote in message
    > news:[email protected]...
    > > OK... here's the question. I have a cell that I input a number into. If

    > I
    > > input a number less than 1, I want the cell to be formated with a

    > percentage
    > > sign. If I input a number greater than 1, I want it to show just as a

    > number
    > > (with no percentage sign).
    > >
    > > I would prefer the answer NOT include a macro as this worksheet will be

    > used
    > > on older computers that have a hard time running macros. If it can't be

    > done
    > > without a macro then a macro will be OK. Any thoughts? and thanks very
    > > much....

    >
    >
    >


  18. #18
    Husker87
    Guest

    Re: How do I change the format of a cell based on what I input?

    Perfect . Thanks Much. Have a good weekend.

    "RagDyeR" wrote:

    > Sorry, forgot to mention:
    >
    > <Tools> <Options> <Edit> tab,
    >
    > And *UNCHECK*
    >
    > "Enable Auto Percent Entry".
    >
    > This custom format doesn't seem to work on versions without this option
    > (XL97).
    > --
    >
    > HTH,
    >
    > RD
    > =====================================================
    > Please keep all correspondence within the Group, so all may benefit!
    > =====================================================
    >
    > "Husker87" <[email protected]> wrote in message
    > news:[email protected]...
    > Works well with the number less than 1 but maybe I'm doing something
    > wrong...
    > it doesn't want to take numbers greater than 1 without the % sign. I tryed
    > 14 and it comes up "14.0%" Any ideas? Thanks for lookng at it....
    >
    > "RagDyer" wrote:
    >
    > > You can try this custom format:
    > >
    > > [>=1]#,###.00;[<1]#.0%;GeneraÂ*l
    > >
    > > --
    > > HTH,
    > >
    > > RD
    > > ==============================================
    > > Please keep all correspondence within the Group, so all may benefit!
    > > ==============================================
    > >
    > >
    > > "Husker87" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > OK... here's the question. I have a cell that I input a number into.

    > If
    > > I
    > > > input a number less than 1, I want the cell to be formated with a

    > > percentage
    > > > sign. If I input a number greater than 1, I want it to show just as a

    > > number
    > > > (with no percentage sign).
    > > >
    > > > I would prefer the answer NOT include a macro as this worksheet will be

    > > used
    > > > on older computers that have a hard time running macros. If it can't be

    > > done
    > > > without a macro then a macro will be OK. Any thoughts? and thanks very
    > > > much....

    > >
    > >

    >
    >
    >


  19. #19
    Bob Phillips
    Guest

    Re: How do I change the format of a cell based on what I input?

    Conditional formatting won't affect the numberformat so you need code

    Private Sub Worksheet_Change(ByVal Target As Range)
    Const WS_RANGE As String = "H1:H10"

    On Error GoTo ws_exit:
    Application.EnableEvents = False
    If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
    With Target
    If .Value < 1 Then
    .NumberFormat = "0%"
    Else
    .NumberFormat = "General"
    End If
    End With
    End If

    ws_exit:
    Application.EnableEvents = True
    End Sub

    'This is worksheet event code, which means that it needs to be
    'placed in the appropriate worksheet code module, not a standard
    'code module. To do this, right-click on the sheet tab, select
    'the View Code option from the menu, and paste the code in.

    --

    HTH

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


    "Husker87" <[email protected]> wrote in message
    news:[email protected]...
    > OK... here's the question. I have a cell that I input a number into. If

    I
    > input a number less than 1, I want the cell to be formated with a

    percentage
    > sign. If I input a number greater than 1, I want it to show just as a

    number
    > (with no percentage sign).
    >
    > I would prefer the answer NOT include a macro as this worksheet will be

    used
    > on older computers that have a hard time running macros. If it can't be

    done
    > without a macro then a macro will be OK. Any thoughts? and thanks very
    > much....




  20. #20
    RagDyer
    Guest

    Re: How do I change the format of a cell based on what I input?

    Appreciate the feed-back.
    --
    Regards,

    RD
    ==============================================
    Please keep all correspondence within the Group, so all may benefit!
    ==============================================


    "Husker87" <[email protected]> wrote in message
    news:[email protected]...
    > Perfect . Thanks Much. Have a good weekend.
    >
    > "RagDyeR" wrote:
    >
    > > Sorry, forgot to mention:
    > >
    > > <Tools> <Options> <Edit> tab,
    > >
    > > And *UNCHECK*
    > >
    > > "Enable Auto Percent Entry".
    > >
    > > This custom format doesn't seem to work on versions without this option
    > > (XL97).
    > > --
    > >
    > > HTH,
    > >
    > > RD
    > > =====================================================
    > > Please keep all correspondence within the Group, so all may benefit!
    > > =====================================================
    > >
    > > "Husker87" <[email protected]> wrote in message
    > > news:[email protected]...
    > > Works well with the number less than 1 but maybe I'm doing something
    > > wrong...
    > > it doesn't want to take numbers greater than 1 without the % sign. I

    tryed
    > > 14 and it comes up "14.0%" Any ideas? Thanks for lookng at it....
    > >
    > > "RagDyer" wrote:
    > >
    > > > You can try this custom format:
    > > >
    > > > [>=1]#,###.00;[<1]#.0%;GeneraÂ*l
    > > >
    > > > --
    > > > HTH,
    > > >
    > > > RD
    > > > ==============================================
    > > > Please keep all correspondence within the Group, so all may benefit!
    > > > ==============================================
    > > >
    > > >
    > > > "Husker87" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > OK... here's the question. I have a cell that I input a number

    into.
    > > If
    > > > I
    > > > > input a number less than 1, I want the cell to be formated with a
    > > > percentage
    > > > > sign. If I input a number greater than 1, I want it to show just as

    a
    > > > number
    > > > > (with no percentage sign).
    > > > >
    > > > > I would prefer the answer NOT include a macro as this worksheet will

    be
    > > > used
    > > > > on older computers that have a hard time running macros. If it

    can't be
    > > > done
    > > > > without a macro then a macro will be OK. Any thoughts? and thanks

    very
    > > > > much....
    > > >
    > > >

    > >
    > >
    > >



  21. #21
    RagDyeR
    Guest

    Re: How do I change the format of a cell based on what I input?

    Sorry, forgot to mention:

    <Tools> <Options> <Edit> tab,

    And *UNCHECK*

    "Enable Auto Percent Entry".

    This custom format doesn't seem to work on versions without this option
    (XL97).
    --

    HTH,

    RD
    =====================================================
    Please keep all correspondence within the Group, so all may benefit!
    =====================================================

    "Husker87" <[email protected]> wrote in message
    news:[email protected]...
    Works well with the number less than 1 but maybe I'm doing something
    wrong...
    it doesn't want to take numbers greater than 1 without the % sign. I tryed
    14 and it comes up "14.0%" Any ideas? Thanks for lookng at it....

    "RagDyer" wrote:

    > You can try this custom format:
    >
    > [>=1]#,###.00;[<1]#.0%;Genera*l
    >
    > --
    > HTH,
    >
    > RD
    > ==============================================
    > Please keep all correspondence within the Group, so all may benefit!
    > ==============================================
    >
    >
    > "Husker87" <[email protected]> wrote in message
    > news:[email protected]...
    > > OK... here's the question. I have a cell that I input a number into.

    If
    > I
    > > input a number less than 1, I want the cell to be formated with a

    > percentage
    > > sign. If I input a number greater than 1, I want it to show just as a

    > number
    > > (with no percentage sign).
    > >
    > > I would prefer the answer NOT include a macro as this worksheet will be

    > used
    > > on older computers that have a hard time running macros. If it can't be

    > done
    > > without a macro then a macro will be OK. Any thoughts? and thanks very
    > > much....

    >
    >




  22. #22
    RagDyer
    Guest

    Re: How do I change the format of a cell based on what I input?

    You can try this custom format:

    [>=1]#,###.00;[<1]#.0%;GeneraÂ*l

    --
    HTH,

    RD
    ==============================================
    Please keep all correspondence within the Group, so all may benefit!
    ==============================================


    "Husker87" <[email protected]> wrote in message
    news:[email protected]...
    > OK... here's the question. I have a cell that I input a number into. If

    I
    > input a number less than 1, I want the cell to be formated with a

    percentage
    > sign. If I input a number greater than 1, I want it to show just as a

    number
    > (with no percentage sign).
    >
    > I would prefer the answer NOT include a macro as this worksheet will be

    used
    > on older computers that have a hard time running macros. If it can't be

    done
    > without a macro then a macro will be OK. Any thoughts? and thanks very
    > much....



  23. #23
    Temp
    Guest

    Re: How do I change the format of a cell based on what I input?

    Put your number in cell A1 then this formula in cell B1:

    =TEXT(A1,"#,###"&IF(A1<1,"%",""))


  24. #24
    Husker87
    Guest

    Re: How do I change the format of a cell based on what I input?

    Works well with the number less than 1 but maybe I'm doing something wrong...
    it doesn't want to take numbers greater than 1 without the % sign. I tryed
    14 and it comes up "14.0%" Any ideas? Thanks for lookng at it....

    "RagDyer" wrote:

    > You can try this custom format:
    >
    > [>=1]#,###.00;[<1]#.0%;GeneraÂ*l
    >
    > --
    > HTH,
    >
    > RD
    > ==============================================
    > Please keep all correspondence within the Group, so all may benefit!
    > ==============================================
    >
    >
    > "Husker87" <[email protected]> wrote in message
    > news:[email protected]...
    > > OK... here's the question. I have a cell that I input a number into. If

    > I
    > > input a number less than 1, I want the cell to be formated with a

    > percentage
    > > sign. If I input a number greater than 1, I want it to show just as a

    > number
    > > (with no percentage sign).
    > >
    > > I would prefer the answer NOT include a macro as this worksheet will be

    > used
    > > on older computers that have a hard time running macros. If it can't be

    > done
    > > without a macro then a macro will be OK. Any thoughts? and thanks very
    > > much....

    >
    >


  25. #25
    Temp
    Guest

    Re: How do I change the format of a cell based on what I input?

    Put your number in cell A1 then this formula in cell B1:

    =TEXT(A1,"#,###"&IF(A1<1,"%",""))


  26. #26
    RagDyer
    Guest

    Re: How do I change the format of a cell based on what I input?

    Appreciate the feed-back.
    --
    Regards,

    RD
    ==============================================
    Please keep all correspondence within the Group, so all may benefit!
    ==============================================


    "Husker87" <[email protected]> wrote in message
    news:[email protected]...
    > Perfect . Thanks Much. Have a good weekend.
    >
    > "RagDyeR" wrote:
    >
    > > Sorry, forgot to mention:
    > >
    > > <Tools> <Options> <Edit> tab,
    > >
    > > And *UNCHECK*
    > >
    > > "Enable Auto Percent Entry".
    > >
    > > This custom format doesn't seem to work on versions without this option
    > > (XL97).
    > > --
    > >
    > > HTH,
    > >
    > > RD
    > > =====================================================
    > > Please keep all correspondence within the Group, so all may benefit!
    > > =====================================================
    > >
    > > "Husker87" <[email protected]> wrote in message
    > > news:[email protected]...
    > > Works well with the number less than 1 but maybe I'm doing something
    > > wrong...
    > > it doesn't want to take numbers greater than 1 without the % sign. I

    tryed
    > > 14 and it comes up "14.0%" Any ideas? Thanks for lookng at it....
    > >
    > > "RagDyer" wrote:
    > >
    > > > You can try this custom format:
    > > >
    > > > [>=1]#,###.00;[<1]#.0%;GeneraÂ*l
    > > >
    > > > --
    > > > HTH,
    > > >
    > > > RD
    > > > ==============================================
    > > > Please keep all correspondence within the Group, so all may benefit!
    > > > ==============================================
    > > >
    > > >
    > > > "Husker87" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > OK... here's the question. I have a cell that I input a number

    into.
    > > If
    > > > I
    > > > > input a number less than 1, I want the cell to be formated with a
    > > > percentage
    > > > > sign. If I input a number greater than 1, I want it to show just as

    a
    > > > number
    > > > > (with no percentage sign).
    > > > >
    > > > > I would prefer the answer NOT include a macro as this worksheet will

    be
    > > > used
    > > > > on older computers that have a hard time running macros. If it

    can't be
    > > > done
    > > > > without a macro then a macro will be OK. Any thoughts? and thanks

    very
    > > > > much....
    > > >
    > > >

    > >
    > >
    > >



  27. #27
    RagDyer
    Guest

    Re: How do I change the format of a cell based on what I input?

    You can try this custom format:

    [>=1]#,###.00;[<1]#.0%;GeneraÂ*l

    --
    HTH,

    RD
    ==============================================
    Please keep all correspondence within the Group, so all may benefit!
    ==============================================


    "Husker87" <[email protected]> wrote in message
    news:[email protected]...
    > OK... here's the question. I have a cell that I input a number into. If

    I
    > input a number less than 1, I want the cell to be formated with a

    percentage
    > sign. If I input a number greater than 1, I want it to show just as a

    number
    > (with no percentage sign).
    >
    > I would prefer the answer NOT include a macro as this worksheet will be

    used
    > on older computers that have a hard time running macros. If it can't be

    done
    > without a macro then a macro will be OK. Any thoughts? and thanks very
    > much....



  28. #28
    Bob Phillips
    Guest

    Re: How do I change the format of a cell based on what I input?

    Conditional formatting won't affect the numberformat so you need code

    Private Sub Worksheet_Change(ByVal Target As Range)
    Const WS_RANGE As String = "H1:H10"

    On Error GoTo ws_exit:
    Application.EnableEvents = False
    If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
    With Target
    If .Value < 1 Then
    .NumberFormat = "0%"
    Else
    .NumberFormat = "General"
    End If
    End With
    End If

    ws_exit:
    Application.EnableEvents = True
    End Sub

    'This is worksheet event code, which means that it needs to be
    'placed in the appropriate worksheet code module, not a standard
    'code module. To do this, right-click on the sheet tab, select
    'the View Code option from the menu, and paste the code in.

    --

    HTH

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


    "Husker87" <[email protected]> wrote in message
    news:[email protected]...
    > OK... here's the question. I have a cell that I input a number into. If

    I
    > input a number less than 1, I want the cell to be formated with a

    percentage
    > sign. If I input a number greater than 1, I want it to show just as a

    number
    > (with no percentage sign).
    >
    > I would prefer the answer NOT include a macro as this worksheet will be

    used
    > on older computers that have a hard time running macros. If it can't be

    done
    > without a macro then a macro will be OK. Any thoughts? and thanks very
    > much....




  29. #29
    RagDyeR
    Guest

    Re: How do I change the format of a cell based on what I input?

    Sorry, forgot to mention:

    <Tools> <Options> <Edit> tab,

    And *UNCHECK*

    "Enable Auto Percent Entry".

    This custom format doesn't seem to work on versions without this option
    (XL97).
    --

    HTH,

    RD
    =====================================================
    Please keep all correspondence within the Group, so all may benefit!
    =====================================================

    "Husker87" <[email protected]> wrote in message
    news:[email protected]...
    Works well with the number less than 1 but maybe I'm doing something
    wrong...
    it doesn't want to take numbers greater than 1 without the % sign. I tryed
    14 and it comes up "14.0%" Any ideas? Thanks for lookng at it....

    "RagDyer" wrote:

    > You can try this custom format:
    >
    > [>=1]#,###.00;[<1]#.0%;Genera*l
    >
    > --
    > HTH,
    >
    > RD
    > ==============================================
    > Please keep all correspondence within the Group, so all may benefit!
    > ==============================================
    >
    >
    > "Husker87" <[email protected]> wrote in message
    > news:[email protected]...
    > > OK... here's the question. I have a cell that I input a number into.

    If
    > I
    > > input a number less than 1, I want the cell to be formated with a

    > percentage
    > > sign. If I input a number greater than 1, I want it to show just as a

    > number
    > > (with no percentage sign).
    > >
    > > I would prefer the answer NOT include a macro as this worksheet will be

    > used
    > > on older computers that have a hard time running macros. If it can't be

    > done
    > > without a macro then a macro will be OK. Any thoughts? and thanks very
    > > much....

    >
    >




  30. #30
    Husker87
    Guest

    Re: How do I change the format of a cell based on what I input?

    Works well with the number less than 1 but maybe I'm doing something wrong...
    it doesn't want to take numbers greater than 1 without the % sign. I tryed
    14 and it comes up "14.0%" Any ideas? Thanks for lookng at it....

    "RagDyer" wrote:

    > You can try this custom format:
    >
    > [>=1]#,###.00;[<1]#.0%;GeneraÂ*l
    >
    > --
    > HTH,
    >
    > RD
    > ==============================================
    > Please keep all correspondence within the Group, so all may benefit!
    > ==============================================
    >
    >
    > "Husker87" <[email protected]> wrote in message
    > news:[email protected]...
    > > OK... here's the question. I have a cell that I input a number into. If

    > I
    > > input a number less than 1, I want the cell to be formated with a

    > percentage
    > > sign. If I input a number greater than 1, I want it to show just as a

    > number
    > > (with no percentage sign).
    > >
    > > I would prefer the answer NOT include a macro as this worksheet will be

    > used
    > > on older computers that have a hard time running macros. If it can't be

    > done
    > > without a macro then a macro will be OK. Any thoughts? and thanks very
    > > much....

    >
    >


  31. #31
    Husker87
    Guest

    Re: How do I change the format of a cell based on what I input?

    Thanks Bob... work well. One question... when you enter a number greater
    than 1 in a cell that previously had a number less than 1 (with a percentage
    sign) it automatically moves the decimal over two spaces... (1,200 shows up
    as 12.00) then when you enter it again it enters it appears correctly.
    (1,200 is 1,200) Anyway to make it so you can go smoothly back and forth
    between the percent sign and a number greater than one?

    "Bob Phillips" wrote:

    > Conditional formatting won't affect the numberformat so you need code
    >
    > Private Sub Worksheet_Change(ByVal Target As Range)
    > Const WS_RANGE As String = "H1:H10"
    >
    > On Error GoTo ws_exit:
    > Application.EnableEvents = False
    > If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
    > With Target
    > If .Value < 1 Then
    > .NumberFormat = "0%"
    > Else
    > .NumberFormat = "General"
    > End If
    > End With
    > End If
    >
    > ws_exit:
    > Application.EnableEvents = True
    > End Sub
    >
    > 'This is worksheet event code, which means that it needs to be
    > 'placed in the appropriate worksheet code module, not a standard
    > 'code module. To do this, right-click on the sheet tab, select
    > 'the View Code option from the menu, and paste the code in.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Husker87" <[email protected]> wrote in message
    > news:[email protected]...
    > > OK... here's the question. I have a cell that I input a number into. If

    > I
    > > input a number less than 1, I want the cell to be formated with a

    > percentage
    > > sign. If I input a number greater than 1, I want it to show just as a

    > number
    > > (with no percentage sign).
    > >
    > > I would prefer the answer NOT include a macro as this worksheet will be

    > used
    > > on older computers that have a hard time running macros. If it can't be

    > done
    > > without a macro then a macro will be OK. Any thoughts? and thanks very
    > > much....

    >
    >
    >


  32. #32
    Husker87
    Guest

    Re: How do I change the format of a cell based on what I input?

    Perfect . Thanks Much. Have a good weekend.

    "RagDyeR" wrote:

    > Sorry, forgot to mention:
    >
    > <Tools> <Options> <Edit> tab,
    >
    > And *UNCHECK*
    >
    > "Enable Auto Percent Entry".
    >
    > This custom format doesn't seem to work on versions without this option
    > (XL97).
    > --
    >
    > HTH,
    >
    > RD
    > =====================================================
    > Please keep all correspondence within the Group, so all may benefit!
    > =====================================================
    >
    > "Husker87" <[email protected]> wrote in message
    > news:[email protected]...
    > Works well with the number less than 1 but maybe I'm doing something
    > wrong...
    > it doesn't want to take numbers greater than 1 without the % sign. I tryed
    > 14 and it comes up "14.0%" Any ideas? Thanks for lookng at it....
    >
    > "RagDyer" wrote:
    >
    > > You can try this custom format:
    > >
    > > [>=1]#,###.00;[<1]#.0%;GeneraÂ*l
    > >
    > > --
    > > HTH,
    > >
    > > RD
    > > ==============================================
    > > Please keep all correspondence within the Group, so all may benefit!
    > > ==============================================
    > >
    > >
    > > "Husker87" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > OK... here's the question. I have a cell that I input a number into.

    > If
    > > I
    > > > input a number less than 1, I want the cell to be formated with a

    > > percentage
    > > > sign. If I input a number greater than 1, I want it to show just as a

    > > number
    > > > (with no percentage sign).
    > > >
    > > > I would prefer the answer NOT include a macro as this worksheet will be

    > > used
    > > > on older computers that have a hard time running macros. If it can't be

    > > done
    > > > without a macro then a macro will be OK. Any thoughts? and thanks very
    > > > much....

    > >
    > >

    >
    >
    >


  33. #33
    RagDyer
    Guest

    Re: How do I change the format of a cell based on what I input?

    Appreciate the feed-back.
    --
    Regards,

    RD
    ==============================================
    Please keep all correspondence within the Group, so all may benefit!
    ==============================================


    "Husker87" <[email protected]> wrote in message
    news:[email protected]...
    > Perfect . Thanks Much. Have a good weekend.
    >
    > "RagDyeR" wrote:
    >
    > > Sorry, forgot to mention:
    > >
    > > <Tools> <Options> <Edit> tab,
    > >
    > > And *UNCHECK*
    > >
    > > "Enable Auto Percent Entry".
    > >
    > > This custom format doesn't seem to work on versions without this option
    > > (XL97).
    > > --
    > >
    > > HTH,
    > >
    > > RD
    > > =====================================================
    > > Please keep all correspondence within the Group, so all may benefit!
    > > =====================================================
    > >
    > > "Husker87" <[email protected]> wrote in message
    > > news:[email protected]...
    > > Works well with the number less than 1 but maybe I'm doing something
    > > wrong...
    > > it doesn't want to take numbers greater than 1 without the % sign. I

    tryed
    > > 14 and it comes up "14.0%" Any ideas? Thanks for lookng at it....
    > >
    > > "RagDyer" wrote:
    > >
    > > > You can try this custom format:
    > > >
    > > > [>=1]#,###.00;[<1]#.0%;GeneraÂ*l
    > > >
    > > > --
    > > > HTH,
    > > >
    > > > RD
    > > > ==============================================
    > > > Please keep all correspondence within the Group, so all may benefit!
    > > > ==============================================
    > > >
    > > >
    > > > "Husker87" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > OK... here's the question. I have a cell that I input a number

    into.
    > > If
    > > > I
    > > > > input a number less than 1, I want the cell to be formated with a
    > > > percentage
    > > > > sign. If I input a number greater than 1, I want it to show just as

    a
    > > > number
    > > > > (with no percentage sign).
    > > > >
    > > > > I would prefer the answer NOT include a macro as this worksheet will

    be
    > > > used
    > > > > on older computers that have a hard time running macros. If it

    can't be
    > > > done
    > > > > without a macro then a macro will be OK. Any thoughts? and thanks

    very
    > > > > much....
    > > >
    > > >

    > >
    > >
    > >



  34. #34
    Husker87
    Guest

    Re: How do I change the format of a cell based on what I input?

    Thanks Bob... work well. One question... when you enter a number greater
    than 1 in a cell that previously had a number less than 1 (with a percentage
    sign) it automatically moves the decimal over two spaces... (1,200 shows up
    as 12.00) then when you enter it again it enters it appears correctly.
    (1,200 is 1,200) Anyway to make it so you can go smoothly back and forth
    between the percent sign and a number greater than one?

    "Bob Phillips" wrote:

    > Conditional formatting won't affect the numberformat so you need code
    >
    > Private Sub Worksheet_Change(ByVal Target As Range)
    > Const WS_RANGE As String = "H1:H10"
    >
    > On Error GoTo ws_exit:
    > Application.EnableEvents = False
    > If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
    > With Target
    > If .Value < 1 Then
    > .NumberFormat = "0%"
    > Else
    > .NumberFormat = "General"
    > End If
    > End With
    > End If
    >
    > ws_exit:
    > Application.EnableEvents = True
    > End Sub
    >
    > 'This is worksheet event code, which means that it needs to be
    > 'placed in the appropriate worksheet code module, not a standard
    > 'code module. To do this, right-click on the sheet tab, select
    > 'the View Code option from the menu, and paste the code in.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Husker87" <[email protected]> wrote in message
    > news:[email protected]...
    > > OK... here's the question. I have a cell that I input a number into. If

    > I
    > > input a number less than 1, I want the cell to be formated with a

    > percentage
    > > sign. If I input a number greater than 1, I want it to show just as a

    > number
    > > (with no percentage sign).
    > >
    > > I would prefer the answer NOT include a macro as this worksheet will be

    > used
    > > on older computers that have a hard time running macros. If it can't be

    > done
    > > without a macro then a macro will be OK. Any thoughts? and thanks very
    > > much....

    >
    >
    >


  35. #35
    Husker87
    Guest

    How do I change the format of a cell based on what I input?

    OK... here's the question. I have a cell that I input a number into. If I
    input a number less than 1, I want the cell to be formated with a percentage
    sign. If I input a number greater than 1, I want it to show just as a number
    (with no percentage sign).

    I would prefer the answer NOT include a macro as this worksheet will be used
    on older computers that have a hard time running macros. If it can't be done
    without a macro then a macro will be OK. Any thoughts? and thanks very
    much....

  36. #36
    Bob Phillips
    Guest

    Re: How do I change the format of a cell based on what I input?

    Conditional formatting won't affect the numberformat so you need code

    Private Sub Worksheet_Change(ByVal Target As Range)
    Const WS_RANGE As String = "H1:H10"

    On Error GoTo ws_exit:
    Application.EnableEvents = False
    If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
    With Target
    If .Value < 1 Then
    .NumberFormat = "0%"
    Else
    .NumberFormat = "General"
    End If
    End With
    End If

    ws_exit:
    Application.EnableEvents = True
    End Sub

    'This is worksheet event code, which means that it needs to be
    'placed in the appropriate worksheet code module, not a standard
    'code module. To do this, right-click on the sheet tab, select
    'the View Code option from the menu, and paste the code in.

    --

    HTH

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


    "Husker87" <[email protected]> wrote in message
    news:[email protected]...
    > OK... here's the question. I have a cell that I input a number into. If

    I
    > input a number less than 1, I want the cell to be formated with a

    percentage
    > sign. If I input a number greater than 1, I want it to show just as a

    number
    > (with no percentage sign).
    >
    > I would prefer the answer NOT include a macro as this worksheet will be

    used
    > on older computers that have a hard time running macros. If it can't be

    done
    > without a macro then a macro will be OK. Any thoughts? and thanks very
    > much....




  37. #37
    Husker87
    Guest

    Re: How do I change the format of a cell based on what I input?

    Perfect . Thanks Much. Have a good weekend.

    "RagDyeR" wrote:

    > Sorry, forgot to mention:
    >
    > <Tools> <Options> <Edit> tab,
    >
    > And *UNCHECK*
    >
    > "Enable Auto Percent Entry".
    >
    > This custom format doesn't seem to work on versions without this option
    > (XL97).
    > --
    >
    > HTH,
    >
    > RD
    > =====================================================
    > Please keep all correspondence within the Group, so all may benefit!
    > =====================================================
    >
    > "Husker87" <[email protected]> wrote in message
    > news:[email protected]...
    > Works well with the number less than 1 but maybe I'm doing something
    > wrong...
    > it doesn't want to take numbers greater than 1 without the % sign. I tryed
    > 14 and it comes up "14.0%" Any ideas? Thanks for lookng at it....
    >
    > "RagDyer" wrote:
    >
    > > You can try this custom format:
    > >
    > > [>=1]#,###.00;[<1]#.0%;GeneraÂ*l
    > >
    > > --
    > > HTH,
    > >
    > > RD
    > > ==============================================
    > > Please keep all correspondence within the Group, so all may benefit!
    > > ==============================================
    > >
    > >
    > > "Husker87" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > OK... here's the question. I have a cell that I input a number into.

    > If
    > > I
    > > > input a number less than 1, I want the cell to be formated with a

    > > percentage
    > > > sign. If I input a number greater than 1, I want it to show just as a

    > > number
    > > > (with no percentage sign).
    > > >
    > > > I would prefer the answer NOT include a macro as this worksheet will be

    > > used
    > > > on older computers that have a hard time running macros. If it can't be

    > > done
    > > > without a macro then a macro will be OK. Any thoughts? and thanks very
    > > > much....

    > >
    > >

    >
    >
    >


  38. #38
    RagDyer
    Guest

    Re: How do I change the format of a cell based on what I input?

    You can try this custom format:

    [>=1]#,###.00;[<1]#.0%;GeneraÂ*l

    --
    HTH,

    RD
    ==============================================
    Please keep all correspondence within the Group, so all may benefit!
    ==============================================


    "Husker87" <[email protected]> wrote in message
    news:[email protected]...
    > OK... here's the question. I have a cell that I input a number into. If

    I
    > input a number less than 1, I want the cell to be formated with a

    percentage
    > sign. If I input a number greater than 1, I want it to show just as a

    number
    > (with no percentage sign).
    >
    > I would prefer the answer NOT include a macro as this worksheet will be

    used
    > on older computers that have a hard time running macros. If it can't be

    done
    > without a macro then a macro will be OK. Any thoughts? and thanks very
    > much....



  39. #39
    RagDyeR
    Guest

    Re: How do I change the format of a cell based on what I input?

    Sorry, forgot to mention:

    <Tools> <Options> <Edit> tab,

    And *UNCHECK*

    "Enable Auto Percent Entry".

    This custom format doesn't seem to work on versions without this option
    (XL97).
    --

    HTH,

    RD
    =====================================================
    Please keep all correspondence within the Group, so all may benefit!
    =====================================================

    "Husker87" <[email protected]> wrote in message
    news:[email protected]...
    Works well with the number less than 1 but maybe I'm doing something
    wrong...
    it doesn't want to take numbers greater than 1 without the % sign. I tryed
    14 and it comes up "14.0%" Any ideas? Thanks for lookng at it....

    "RagDyer" wrote:

    > You can try this custom format:
    >
    > [>=1]#,###.00;[<1]#.0%;Genera*l
    >
    > --
    > HTH,
    >
    > RD
    > ==============================================
    > Please keep all correspondence within the Group, so all may benefit!
    > ==============================================
    >
    >
    > "Husker87" <[email protected]> wrote in message
    > news:[email protected]...
    > > OK... here's the question. I have a cell that I input a number into.

    If
    > I
    > > input a number less than 1, I want the cell to be formated with a

    > percentage
    > > sign. If I input a number greater than 1, I want it to show just as a

    > number
    > > (with no percentage sign).
    > >
    > > I would prefer the answer NOT include a macro as this worksheet will be

    > used
    > > on older computers that have a hard time running macros. If it can't be

    > done
    > > without a macro then a macro will be OK. Any thoughts? and thanks very
    > > much....

    >
    >




  40. #40
    Temp
    Guest

    Re: How do I change the format of a cell based on what I input?

    Put your number in cell A1 then this formula in cell B1:

    =TEXT(A1,"#,###"&IF(A1<1,"%",""))


  41. #41
    Husker87
    Guest

    Re: How do I change the format of a cell based on what I input?

    Works well with the number less than 1 but maybe I'm doing something wrong...
    it doesn't want to take numbers greater than 1 without the % sign. I tryed
    14 and it comes up "14.0%" Any ideas? Thanks for lookng at it....

    "RagDyer" wrote:

    > You can try this custom format:
    >
    > [>=1]#,###.00;[<1]#.0%;GeneraÂ*l
    >
    > --
    > HTH,
    >
    > RD
    > ==============================================
    > Please keep all correspondence within the Group, so all may benefit!
    > ==============================================
    >
    >
    > "Husker87" <[email protected]> wrote in message
    > news:[email protected]...
    > > OK... here's the question. I have a cell that I input a number into. If

    > I
    > > input a number less than 1, I want the cell to be formated with a

    > percentage
    > > sign. If I input a number greater than 1, I want it to show just as a

    > number
    > > (with no percentage sign).
    > >
    > > I would prefer the answer NOT include a macro as this worksheet will be

    > used
    > > on older computers that have a hard time running macros. If it can't be

    > done
    > > without a macro then a macro will be OK. Any thoughts? and thanks very
    > > much....

    >
    >


+ 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