+ Reply to Thread
Results 1 to 2 of 2

Thread: 'currency format' and formula question in vba excel 2010

  1. #1
    Registered User
    Join Date
    02-08-2012
    Location
    united states
    MS-Off Ver
    excel 2010
    Posts
    1

    'currency format' and formula question in vba excel 2010

    i have the following for my userform:

    one text box is txtbaserate,
    the other text box is txtannualsal.

    my base rate text box is not showing $00.00. It's showing $0.00.
    here is my code.
    Private Sub txtbaserate_change()
          txtbaserate.Text = Format(txtbaserate.Text, "$#,##0.00")
    End Sub
    My other question is how do I show a calculation to get an annual salary in my other text box?

    =txtbaserate*40*52?

    I must be clueless!!!!
    thank you!
    Last edited by Paul; 02-09-2012 at 12:41 AM. Reason: Added CODE tags for new user.

  2. #2
    Forum Moderator Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    5,953

    Re: 'currency format' and formula question in vba excel 2010

    Is this homework? Those variable names have to be in just about every coding textbook I've ever read.

    Do some searching on "vba format numbers" and see if you can figure out the difference between # and 0 in the format expression.

    As for determining the salary, you already have the textbox change code for when you change the value in txtbaserate, so you just need to add the mathematical function you stated and assign that value to txtannualsal.

+ 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.2.0