Consulting

Results 1 to 3 of 3

Thread: ControlProperty

  1. #1

    ControlProperty

    I am working with multiple sheets but I do not know how to popoulate a textbox from Sheet2.

    Sheet2:C22

    It does not work.

  2. #2

    UserForm Initialize and Format TextBox

    I am using the following code to format a textbox. Does not work at all.

    Private Sub UserForm_Initialize()
    TextBox1.Text = Format((TextBox1.Value),"$#,##0")
    End Sub

    Any thoughts?

  3. #3
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    While not all cell numberformats will work like this, many will.

    [vba] Private Sub UserForm_Initialize()
    TextBox1.Text = Format(Sheet2.Range("C22").Value, Sheet2.Range("C22").NumberFormat)
    'or
    ' TextBox1.Text = Sheet2.Range("C22").Text
    End Sub[/vba]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •