Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default check format



Hello

Is it possible to check the fromat of a text, color and bold, in a cell?

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default check format

Using the Characters.Font property of the cell - something like this
maybe...

Dim Status As String
With Range("A1").Characters.Font
If .Bold Then Status = "Bold, "
If .Italic Then Status = Status & "Italic, "
If .Strikethrough Then Status = Status & "Strikethrough, "
If .Shadow Then Status = Status & "Shadow, "
If .OutlineFont Then Status = Status & "OutlineFont, "
If .Subscript Then Status = Status & "Subscript, "
If .Superscript Then Status = Status & "Superscript, "
If .Underline Then Status = Status & "Underline, "
Status = Status & "Size=" & .Size & ", "
Status = Status & "ColorIndex=" & .ColorIndex
End With
MsgBox Status

--
Rick (MVP - Excel)


"Rolf G" wrote in message
...


Hello

Is it possible to check the fromat of a text, color and bold, in a cell?

Thanks

*** Sent via Developersdex http://www.developersdex.com ***


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default check format

This will check the font size and wheter the font is bold in range B2.

Sub chkFont()
s = Range("B2").Font.Size
fs = Range("B2").Font.Bold
MsgBox s & " " & fs
End Sub



"Rolf G" wrote:



Hello

Is it possible to check the fromat of a text, color and bold, in a cell?

Thanks

*** Sent via Developersdex http://www.developersdex.com ***

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default check format

To check the color, simply use ColorIndex instead of Size or Bold.

"Rolf G" wrote:



Hello

Is it possible to check the fromat of a text, color and bold, in a cell?

Thanks

*** Sent via Developersdex http://www.developersdex.com ***

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default check format

JLGWhiz is correct in using the Font property directly instead of vectoring
through the Characters property. Change the With statement in my posting to
this...

With Range("A1").Font

and use the rest of the code as posted.

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
Using the Characters.Font property of the cell - something like this
maybe...

Dim Status As String
With Range("A1").Characters.Font
If .Bold Then Status = "Bold, "
If .Italic Then Status = Status & "Italic, "
If .Strikethrough Then Status = Status & "Strikethrough, "
If .Shadow Then Status = Status & "Shadow, "
If .OutlineFont Then Status = Status & "OutlineFont, "
If .Subscript Then Status = Status & "Subscript, "
If .Superscript Then Status = Status & "Superscript, "
If .Underline Then Status = Status & "Underline, "
Status = Status & "Size=" & .Size & ", "
Status = Status & "ColorIndex=" & .ColorIndex
End With
MsgBox Status

--
Rick (MVP - Excel)


"Rolf G" wrote in message
...


Hello

Is it possible to check the fromat of a text, color and bold, in a cell?

Thanks

*** Sent via Developersdex http://www.developersdex.com ***





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default check format





*** Sent via Developersdex http://www.developersdex.com ***
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
Check if Conditional Format is True or False / Check cell Color Kevin McCartney Excel Worksheet Functions 5 June 29th 07 11:12 AM
Check Format Student Excel Programming 3 October 26th 06 03:56 PM
Check box format AnthonyJ Excel Programming 1 October 12th 06 02:34 PM
Cell Format Check Rich[_30_] Excel Programming 3 May 17th 06 04:54 PM
Check Box Format! Kim-Anh Tran Excel Programming 5 May 3rd 04 11:01 PM


All times are GMT +1. The time now is 11:33 PM.

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

About Us

"It's about Microsoft Excel"