+ Reply to Thread
Results 1 to 5 of 5

Put a textboxvalue formatted "#,##0" to a cell formed as value not text

Hybrid View

  1. #1
    Registered User
    Join Date
    02-20-2014
    Location
    Norrköping, sweden
    MS-Off Ver
    Excel 2010
    Posts
    3

    Put a textboxvalue formatted "#,##0" to a cell formed as value not text

    I've made a userform that gets at value from a worksheet and at the sam time format it as #,##0. When transfering it back to the worksheet it's textstring but i want it to be a value. Please help
    Bengt

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Put a textboxvalue formatted "#,##0" to a cell formed as value not text

    Post your code.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    02-20-2014
    Location
    Norrköping, sweden
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Put a textboxvalue formatted "#,##0" to a cell formed as value not text

    Private Sub UserForm_Initialize()
    
    TextBox1.Value = Format(Sheets("Sheet1").Range("A1").Value, "#,##0")
    
    
    End Sub
    
    
    Private Sub CommandButton1_Click()
    Sheets("Sheet1").Range("A2").Value = TextBox1.Value
    UserForm1.Hide
    Unload UserForm1
    
    End Sub
    Thats my code as an example of my problem. In cell A2 i want a value because, later on I want to sum the column A.
    Last edited by Leith Ross; 02-21-2014 at 12:12 PM.

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Put a textboxvalue formatted "#,##0" to a cell formed as value not text

    Change to:
    Private Sub CommandButton1_Click()
        Sheets("Sheet1").Range("A2").Value = CDbl(TextBox1.Value)
        UserForm1.Hide
        Unload UserForm1
    End Sub

  5. #5
    Registered User
    Join Date
    02-20-2014
    Location
    Norrköping, sweden
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Put a textboxvalue formatted "#,##0" to a cell formed as value not text

    Thank You!!!!

    That saved me a lot of new gray hair!

    Best Regards/Bengt

+ 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. [SOLVED] How to convert "26:38:00" to "26:38" when the cell is formatted as Time?
    By PistachioPedro in forum Excel General
    Replies: 2
    Last Post: 11-15-2013, 06:49 PM
  2. Interrogate value of "text" in custom formatted cell
    By margalo in forum Excel General
    Replies: 0
    Last Post: 10-16-2012, 12:25 PM
  3. Replies: 3
    Last Post: 06-30-2008, 06:58 AM
  4. In Excel a cell formatted "currency" shows "######" help!
    By llveda in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-07-2006, 04:40 PM
  5. Replies: 7
    Last Post: 01-13-2006, 05:20 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