Results 1 to 8 of 8

How to pass a TextBox

Threaded View

  1. #1
    Registered User
    Join Date
    12-24-2010
    Location
    Manchester England
    MS-Off Ver
    Excel 2007
    Posts
    11

    How to pass a TextBox

    Dear Forum Members

    I need to change the Font and color of one or all of several textboxes if they have been left blank.
    I had hoped to do this by refering to a proceedure using code like this:_
    If tbWidth.value="" Then
    Call ChangeFont(tbWidth)
    End If
    End Sub
    Sub ChangeFont(MyTextBox as TextBox)
    MyTextBox.Text="***"
    MyTextBox.Font=14
    MyTextBox.ForeColour=vbRed
    End Sub
    Using tbWidth, Me.tbWidth, .tbWidth in the Call line all give error messages.
    The code in Sub ChangeFont works if written directly in the calling procedure
    Can anyone help please
    Ems
    Last edited by Emilysouth; 02-13-2011 at 05:56 PM.

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