+ Reply to Thread
Results 1 to 7 of 7

Number Stored as Text

  1. #1
    Registered User
    Join Date
    02-24-2014
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    47

    Number Stored as Text

    have a userform that when textbox number value goes to excel worksheet i have to always convert to number because the 'number is stored as text'. this is messing up my formulas in the worksheet. was wondering what i can do on my userform OR worksheet to prevent this

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Number Stored as Text

    Please post the code you use to write the form value to the cell(s).
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    02-24-2014
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Number Stored as Text

    using a spinbutton to control the textbox, this is the code behind one of the spinbuttons

    Private Sub sbscore1_Change()
    txtscore1.Text = sbscore1.Value
    End Sub



    thanks.

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Number Stored as Text

    I think that code writes the spinbutton value to the textbox named "txtscore1".
    What code writes the value to the cell on the worksheet?

  5. #5
    Registered User
    Join Date
    02-24-2014
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Number Stored as Text

    here's the code that from the 'submit' button that moves everything from the userform to the worksheet
    Private Sub cmdSubmit_Click()
    Dim WS As Worksheet
    Dim NextRow As Long

    Set WS = Worksheets("userformworksheet")

    With WS
    NextRow = .Cells(.Rows.Count, "A").End(xlUp).Row + 1

    .Range("A" & NextRow) = Me.cmbscreener
    .Range("B" & NextRow) = Me.cmbreviewer
    .Range("C" & NextRow) = Me.cmbsupervisor
    .Range("D" & NextRow) = Me.cmbdisposition
    .Range("E" & NextRow) = Me.cmbcampaign
    .Range("F" & NextRow) = Me.cmbagentgroup
    .Range("G" & NextRow) = Me.txtdateofcall
    .Range("H" & NextRow) = Me.txtdateofmonitor
    .Range("I" & NextRow) = Me.txtcallid
    .Range("j" & NextRow) = Me.txtpossible1
    .Range("k" & NextRow) = Me.txtscore1
    .Range("m" & NextRow) = Me.txtpossible2
    .Range("n" & NextRow) = Me.txtscore2
    .Range("p" & NextRow) = Me.txtpossible3
    .Range("q" & NextRow) = Me.txtscore3
    .Range("s" & NextRow) = Me.txtpossible4
    .Range("t" & NextRow) = Me.txtscore4
    .Range("v" & NextRow) = Me.txtpossible5
    .Range("w" & NextRow) = Me.txtscore5
    .Range("y" & NextRow) = Me.txtpossible6
    .Range("z" & NextRow) = Me.txtscore6
    .Range("ab" & NextRow) = Me.txtpossible7
    .Range("ac" & NextRow) = Me.txtscore7
    .Range("ae" & NextRow) = Me.txtpossible8
    .Range("af" & NextRow) = Me.txtscore8

    .Range("ah" & NextRow) = Me.cbxfail1
    .Range("ai" & NextRow) = Me.cbxfail2
    .Range("aj" & NextRow) = Me.cbxfail3
    .Range("ak" & NextRow) = Me.cbxfail4
    .Range("al" & NextRow) = Me.cbxfail5

    .Range("am" & NextRow) = Me.txtpossiblepoints
    .Range("an" & NextRow) = Me.txtpointsearned
    .Range("ao" & NextRow) = Me.txtqascore
    .Range("ax" & NextRow) = Me.txtnotes
    End With

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Number Stored as Text

    Untested: Does this line work for you?
    Please Login or Register  to view this content.
    or maybe
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    02-24-2014
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Number Stored as Text

    awesome, first code worked. thanks!

+ 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] Number stored as text
    By jagon in forum Excel General
    Replies: 8
    Last Post: 05-06-2014, 08:58 AM
  2. [SOLVED] Number Stored as text - Tried every possible way
    By muneshmeena in forum Excel General
    Replies: 4
    Last Post: 03-24-2013, 03:22 AM
  3. Replies: 1
    Last Post: 10-28-2012, 05:42 AM
  4. Number stored as text
    By Andrew Clark in forum Excel General
    Replies: 1
    Last Post: 11-08-2005, 06:30 PM
  5. Number stored as text
    By sueanne in forum Excel General
    Replies: 1
    Last Post: 03-02-2005, 11:16 PM

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