View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Brian Taylor Brian Taylor is offline
external usenet poster
 
Posts: 52
Default Conditional Formating with Function

You can use concatenated information in conditional formatting and you
can concatenate text with numbers. The only time concatenating gets
tricky is when you have dates (since they are really numbers). But you
can get around that with the date and time formulas.

In conditional formatting use the "formula is" option. Then use a
formula like this:

="I am number " & A1 = "I am number 1"

This will return a true or false statement. If the statement is true
the conditional formatting will be applied.

If you are talking VBA, it is also possible to concatenate text and
numbers:

Sub test()
Dim i As Integer
Dim str As String

i = 5
str = "I am " & i
MsgBox str
End Sub

This will return "I am 5"