+ Reply to Thread
Results 1 to 5 of 5

Convert TextBox value to Currency

Hybrid View

  1. #1
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Convert TextBox value to Currency

    Hi All

    I have the following snippet of code I need assistance with. I am trying to get ws.Range("F9") to display R652000.00
    and have the availability of calculating commissions from this value without faulting as it reads value as string.
    Dim Total As Long
    Total = Application.WorksheetFunction.VLookup("TOTAL", ss.Range("A6:E5000"), 5, False)
    'Assuming Total.value = 652000.00
    UserForm1.TextBox1 = Format(Total, "R#,## 0.00")
    ws.Range("F9") = UserForm1.TextBox1.Value
    This formula renders an incorrect answer after the sheet is populated
    Formula: copy to clipboard
    =IF(F9="","",IF(F9>E3,(F9*0.25/100),0))

    Any help please.

    I had a cross post which I marked as solved in Formula section thinking it was the formula....
    https://www.excelforum.com/excel-for...ml#post4665855
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Convert TextBox value to Currency

    Hi Sintek
        With Range("F9")
        .Value = Val(Mid(UserForm1.TextBox1.Value, 2))
        'or just .Value = Total
        .NumberFormat = "[$R-af-ZA]#,##0.00"
        End With
    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 05-31-2017 at 11:19 AM.

  3. #3
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Convert TextBox value to Currency

    Decided just to go numbers throughout....No currency...

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Convert TextBox value to Currency

    Hi leelnich

    thanks for your response...
    tried but no avail....Still converts to custom and errors formula

  5. #5
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Convert TextBox value to Currency

    I'm surprised, that Cell number format displayed the NUMBER 652000.00 as R652,000.00 perfectly. Sorry we couldn't find a solution. Take care-Lee
    Last edited by leelnich; 05-31-2017 at 02:34 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Format textbox to currency
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-01-2016, 04:29 PM
  2. [SOLVED] Easy One - Convert user text in UserForm TextBox to Currency
    By DonJuan85 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-06-2015, 01:42 PM
  3. Easy One - Convert user text in UserForm TextBox to Currency
    By DonJuan85 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-29-2015, 07:00 PM
  4. Formatting textbox to currency...?
    By RayJay01 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-26-2013, 05:32 PM
  5. Replies: 5
    Last Post: 11-18-2010, 05:37 PM
  6. Textbox to Display Currency
    By James12 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-24-2009, 10:22 PM
  7. currency and textbox.
    By funkymonkUK in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 05-27-2005, 06:42 AM

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