+ Reply to Thread
Results 1 to 16 of 16

TextBox Change Event HELP

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,101

    Re: TextBox Change Event HELP

    Hi Mehmetcik,

    Have tried copying the latest code and still doesn't work.

    Did you really not see the attached file? It was on the very first post of this thread.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: TextBox Change Event HELP

    Ok I've modified your code for textbox1.

    As follows:-

    Private Sub TextBox1_Change()

    If flag = True Then GoTo 200

    temp = TextBox1.Value
    If Right(temp, 1) = "%" Then temp = Left(temp, Len(temp) - 1)


    If Len(Me.TextBox1) >= 1 And Not IsNumeric(temp) Then

    MsgBox "Sorry, only numbers allowed"

    TextBox1.Value = vbNullString
    ActiveSheet.Label1.Caption = ""
    ActiveSheet.Label12.Caption = ""
    temp = 36

    Else: flag = Not flag
    If flag = True Then TextBox1.Value = Format(temp / 100, "0.00%")


    20 End If

    If Range("C16").Value = 0 Then
    ActiveSheet.Label49.Caption = ""
    ElseIf Range("C16").Value >= 50 Then
    With ActiveSheet.Label49
    .Caption = Format(Range("E16").Value, "$#,#.00")
    .Font.Size = 48
    End With
    Else
    With ActiveSheet.Label49
    .Caption = "Min 50 Phones."
    .Font.Size = 35
    End With
    End If

    GoTo 300

    200 flag = False

    ActiveSheet.Label1.Caption = Range("D3")
    ActiveSheet.Label12.Caption = Format(Range("E3").Value, "$#,#.00")
    300 ' exit

    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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