Re: Text box format VBA
From: Harald Staff (innocent_at_enron.invalid)
Date: 02/01/04
- Next message: Joseph: "Sendkeys and NumLock Key"
- Previous message: Harald Staff: "Re: VBA code halts after opening a file"
- In reply to: gregork: "Re: Text box format VBA"
- Next in thread: gregork: "Re: Text box format VBA"
- Reply: gregork: "Re: Text box format VBA"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 1 Feb 2004 11:51:24 +0100
"gregork" <gregork@paradise.net.nz> wrote in message
news:t03Tb.20011$ws.2674481@news02.tsnz.net...
> I want to format back colour based on text in a textbox. i.e. If
> textbox27 text="fail" then
> TextBox27.BackColor = &HC0C0FF.
You are very close:
If TextBox27.Text = "fail" Then
TextBox27.BackColor = "&HC0C0FF"
Else
TextBox27.BackColor = "&HFFFFFF"
End If
But consider uppercase, mixed case, part entries, trailing spaces...
If InStr(Trim$(LCase$(TextBox27.Text)), "fail") > 0 Then
reacts also on entry " You FAILED madam"
-- HTH. Best wishes Harald Followup to newsgroup only please.
- Next message: Joseph: "Sendkeys and NumLock Key"
- Previous message: Harald Staff: "Re: VBA code halts after opening a file"
- In reply to: gregork: "Re: Text box format VBA"
- Next in thread: gregork: "Re: Text box format VBA"
- Reply: gregork: "Re: Text box format VBA"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|