Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Conditional Formating with Function


Can it be true that it is impossible to contenate text with of different
format? It is easy to do with a Macro, but a Macro is not flexible
enough to contenate texts as it will not return a string.

The contidional formating option excel offers, is not even able to
solve simple problems as the above mentioned..

Can it be true ?


--
Leitwolf25
------------------------------------------------------------------------
Leitwolf25's Profile: http://www.excelforum.com/member.php...o&userid=34323
View this thread: http://www.excelforum.com/showthread...hreadid=541225

  #2   Report Post  
Posted to microsoft.public.excel.programming
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"

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Conditional Formating with Function


Hi Brian

Sure its possible to contenate text with a funtion, easy as this:

Function AddIt(String1,String2)
AddIt = String1+String2
End Function

But that will not add a bold AND standard text. Also you can not set
any kind of font for the cell. Neither you can take over a textformat
like this "New York" into another cell. I think that its ugly that such
simple things shall be impossible in excel, even if you VBA
programing...


--
Leitwolf25
------------------------------------------------------------------------
Leitwolf25's Profile: http://www.excelforum.com/member.php...o&userid=34323
View this thread: http://www.excelforum.com/showthread...hreadid=541225

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Conditional Formating with Function


Hi Brian

Sure its possible to contenate text with a funtion, easy as this:

Function AddIt(String1,String2)
AddIt = String1+String2
End Function

But that will not add a bold AND standard text. Also you can not set
any kind of font for the cell. Neither you can take over a textformat
like this "New York" into another cell. I think that its ugly that such
simple things shall be impossible in excel, even if you VBA
programing...


--
Leitwolf25
------------------------------------------------------------------------
Leitwolf25's Profile: http://www.excelforum.com/member.php...o&userid=34323
View this thread: http://www.excelforum.com/showthread...hreadid=541225

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Conditional Formating with Function

All formatting properties are properties of the cells. So everything
you mentioned can be done through the cell properties:

change font:
Range("A1").Font.Name = "Times New Roman"

bold with regular text:
ActiveCell.Characters(Start:=1, Length:=3).Font.FontStyle = "Regular"
ActiveCell.Characters(Start:=4, Length:=3).Font.FontStyle = "Bold"

Any property can be done in the same way, font, size, bold, color, etc.

So all you have to do is concatenate the string first and then apply
the formatting through the cell.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Conditional Formating with Function


Hi Taylor

I know this, but i can not put this in a user definied workshee
function. if you try it will only cause an error..

anyway ... i try something else ;-

--
Leitwolf2
-----------------------------------------------------------------------
Leitwolf25's Profile: http://www.excelforum.com/member.php...fo&userid=3432
View this thread: http://www.excelforum.com/showthread.php?threadid=54122

Reply
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 Formating" function grayed out Kevin Excel Discussion (Misc queries) 2 May 29th 09 11:11 PM
Conditional formating only on sum function not on =A1+A2 anil Excel Worksheet Functions 0 January 28th 09 12:15 AM
Conditional Formating or IF Function Alexa M. Excel Discussion (Misc queries) 3 July 23rd 08 04:36 PM
Install dates formating using conditional formating? Jerry Eggleston Excel Discussion (Misc queries) 2 November 9th 05 05:49 PM
Conditional Formating & Rand() function BaldySlaphead Excel Discussion (Misc queries) 10 July 20th 05 03:43 PM


All times are GMT +1. The time now is 08:13 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"