+ Reply to Thread
Results 1 to 2 of 2

VB UserForm

  1. #1
    Forum Contributor
    Join Date
    02-24-2005
    Posts
    154

    VB UserForm

    If I want to change the case from lower case to upper case in the following location I can use the following code.
    Dim cell As Range
    For Each cell In Range("F3").Cells
    If cell.HasFormula = False Then cell = UCase(cell)
    Next

    How do I achieve the same result if the location is a TextBox created in a UserForm. ie TextBox1 in UserForm1

  2. #2
    Peter T
    Guest

    Re: VB UserForm


    Me.TextBox1.Text = UCase(Me.TextBox1.Text)

    If code is not in the form change "Me" to the form name

    Note this will trigger the TextBox Change event if you are using it. If
    necessary set a (global) boolean flag to True/False either side of the above
    code to early exit the event and re-set to false when done.

    Private Sub TextBox1_Change()
    If bExit Then Exit Sub
    End Sub

    Regards,
    Peter T


    "grahammal" <[email protected]> wrote
    in message news:[email protected]...
    >
    > If I want to change the case from lower case to upper case in the
    > following location I can use the following code.
    > Dim cell As Range
    > For Each cell In Range("F3").Cells
    > If cell.HasFormula = False Then cell = UCase(cell)
    > Next
    >
    > How do I achieve the same result if the location is a TextBox created
    > in a UserForm. ie TextBox1 in UserForm1
    >
    >
    > --
    > grahammal
    > ------------------------------------------------------------------------
    > grahammal's Profile:

    http://www.excelforum.com/member.php...o&userid=20336
    > View this thread: http://www.excelforum.com/showthread...hreadid=507615
    >




+ 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.6.0 RC 1