LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 489
Default Conditional formatting in text boxes

Correction,

Private Sub UserForm_Initialize()

Dim i As Long

For i = 1 To 60
With Me.Controls("Textbox" & i)

' bold or unbold font
.Font.Bold = Not Cells(i, "B").Text = ""

' change font color
.BackColor = 255

' change font name
.Font.Name = "Tahoma"
End With
Next i

End Sub


Hope this helps! If so, let me know, click "YES" below.
--
Cheers,
Ryan


"Roger on Excel" wrote:

Dear Jacob,

Thankyou for the code - it works very nicely.

I was able to modify it for my purposes relatively easily. Apologies for
not including the code I am using.

I have a question - how does one change other text attributes using this
code? for example if I want to change the the color to red or even change the
font?

Best regards,

Roger

"Jacob Skaria" wrote:

You should have posted your code..Within your loop add a line something like
the below..

Dim intCount as Integer
For intCount = 1 To 60
Me.Controls("Textbox" & intCount).Font.Bold = _
Not (Range("A" & intCount).Offset(, 1).Text = "")
Next

--
Jacob


"Roger on Excel" wrote:

I have textboxes on a userform.

The text boxes read (and write) to cells A1:A60

Adjacent to these cells I have a comments column which is filled in for
particular rows

Depending on whether the adjacent cell in column B has an entry, is there a
way to make the textboxes change their font attributes? For example, become
BOLD when there is a comment.

Can anyone help?




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional text boxes on Form Anand Excel Programming 1 June 21st 08 12:32 PM
Formatting in Text Boxes Mali[_2_] Excel Programming 3 May 7th 08 01:46 PM
Formatting Text boxes for Date Entry [email protected] Excel Programming 1 May 2nd 06 07:53 PM
formatting text boxes doug Excel Programming 3 February 15th 05 06:53 PM
Check Boxes and Conditional Formatting Steve[_71_] Excel Programming 2 November 29th 04 07:30 PM


All times are GMT +1. The time now is 09:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"