If/else Statement For Textbox

  • Sorry, I'm new here...Not sure if I posted this in the right section...But I need help...


    I made a textbox and I need to write an If/Else statement


    Here it is: But It doesn't work...


    Code
    1. If CDBL (txtMaxPayment.Value) > Range("C9") Then
    2. Range("C9").Font.Color = RGB(0, 0, 0)
    3. Else
    4. Range("C9").Font.Color = RGB(255, 0, 0)


    This is what I have to do...At the end of each procedure I have to include a check that determines if the Monthly Payment in cell C9 is greater than the Maximum Monthly Payment (the textbox I created)...If so, I have to set the font color to RED in C9....Help plz...I'm going crazyyy....I have to use the syntax, CDBL(txtMaxPayment.Value) to make the Maximum Monthly Payment a numeric value...

  • Re: If/else Statement For Textbox


    Welcome to the OzGrid, zz8.


    Two mistakes:


    • You posted in the Email forum. I have moved to the Excel forum.


    • You didn't use code tags, which we observe with a religious fervor. I have added them this time, but please be aware that posts are routinely deleted for their absence.


    I, and any other admin, would have preferred to spend the time reading and responding to your post rather than editing and moving it. Please be mindful in the future.

    [SIZE=1]Entia non sunt multiplicanda sine necessitate.[/SIZE]

  • Re: If/else Statement For Textbox


    Ok...Sorry!! That's why I wasn't sure if I was posting in the right section... Can you please, please help me with my problem??

  • Re: If/else Statement For Textbox


    Quote

    Sorry, I'm new here...Not sure if I posted this in the right section...But I need help...

    Not knowing where to post and the non-use of code tags tells me you haven't read the rules you agreed to, the auto-email that is sent after registration, or the big bold red text on the page you posted from. I suggest you read the rules and the text on the page you post from BEFORE posting any other posts.

  • Re: If/else Statement For Textbox


    Quote from Reafidy

    Where is the textbox from the control or forms toolbar. Or is it on a user form?


    It is from the control toolbox....

  • Re: If/else Statement For Textbox


    Quote from Dave Hawley

    Not knowing where to post and the non-use of code tags tells me you haven't read the rules you agreed to, the auto-email that is sent after registration, or the big bold red text on the page you posted from. I suggest you read the rules and the text on the page you post from BEFORE posting any other posts.


    I'm out...No one seems to be helping....Plus, from the vibe that I got, from this message, I doubt anyone will wanna join...PEACE!

  • Re: If/else Statement For Textbox


    No need to quit, zz8. Our objective is to have a useful, usefully-searchable forum. The rules are simple, and there are some of the most talented Excel people in the world here to help you. Following the rules is not an exorbitant price to pay for free advice.


    So sign up to the rules, and join our family.


    Kind regards,

    [SIZE=1]Entia non sunt multiplicanda sine necessitate.[/SIZE]

  • Re: If/else Statement For Textbox


    Hi zz8,


    If you're not truly gone here's two options for you:


    Both treat the value as a double. Note the sheet# reference before the textbox name.


  • Re: If/else Statement For Textbox


    Quote from shg

    No need to quit, zz8. Our objective is to have a useful, usefully-searchable forum. The rules are simple, and there are some of the most talented Excel people in the world here to help you. Following the rules is not an exorbitant price to pay for free advice.


    So sign up to the rules, and join our family.


    Kind regards,


    Thanks...No, I'm not leaving....I'm still here...I was just frustrated...

  • Re: If/else Statement For Textbox


    Still doesn't work...Argg....I don't know what I'm doing wrong....This is a big project for school, and that is the only part that doesn't work....I refered to books and stuff, and I still don't get it to work....Is there a way you can PM me and I can attach the worksheet...Maybe my instructions weren't clear?? :(

  • Re: If/else Statement For Textbox


    zz8, Two things:
    First and most important, have you PMed Dave with your acceptance of the rules? If not, I suggest you do - it does not go down well to ignore an administrator.


    Secondly, we do not condone sending spreadsheets to or from members. Keep it all in open forum. Attach your worksheet, using Zip if necessary to keep the size down. If it is still too big, make a small sample workbook showing the layout and the problem and attach that.

  • Re: If/else Statement For Textbox


    I did PM the Admin....How do I Zip my attachment?? You know what....It's fine....I don't wanna bug you guys...Thanks for everything...I'll have to figure it out somehow...

  • Re: If/else Statement For Textbox


    zz8kobefan8zz , how "frustrated" do you those are who are trying to help you???? You still don't seem to have read the rules as you asked how to PM an attachment!


    You seem to believe because YOU are "frustrated" all those trying to help should make you a special case.


    Let me even more blunt as you don't seem to get it. Either stay and abide by the rules to which YOU agreed, or leave. It's that simple.

  • Re: If/else Statement For Textbox


    Quote from ByTheCringe2

    Did I say something... :(


    No....lol....I just can't seem to find the problem....It's fine, I'll have to leave it that way...Thank You guys for your help though!!! :p