Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default VBA for SELECTING ONLY BOLD CELL

Could one please devise a simple code which would be selecting cells with a
Bold format within a range.

In other words:

For each cell in selection.

Thanx.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default VBA for SELECTING ONLY BOLD CELL

Hi,

Try this

Sub Select_Bold()
Dim BoldRange As Range
For Each c In ActiveSheet.UsedRange
If c.Font.Bold Then
If BoldRange Is Nothing Then
Set BoldRange = c
Else
Set BoldRange = Union(BoldRange, c)
End If
End If
Next
If Not BoldRange Is Nothing Then
BoldRange.Select
End If
End Sub

Mike

"FARAZ QURESHI" wrote:

Could one please devise a simple code which would be selecting cells with a
Bold format within a range.

In other words:

For each cell in selection.

Thanx.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default VBA for SELECTING ONLY BOLD CELL

Hi

For Each c In ActiveSheet.UsedRange

can be replaced with

For Each c In Selection

Mike

"Mike H" wrote:

Hi,

Try this

Sub Select_Bold()
Dim BoldRange As Range
For Each c In ActiveSheet.UsedRange
If c.Font.Bold Then
If BoldRange Is Nothing Then
Set BoldRange = c
Else
Set BoldRange = Union(BoldRange, c)
End If
End If
Next
If Not BoldRange Is Nothing Then
BoldRange.Select
End If
End Sub

Mike

"FARAZ QURESHI" wrote:

Could one please devise a simple code which would be selecting cells with a
Bold format within a range.

In other words:

For each cell in selection.

Thanx.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default VBA for SELECTING ONLY BOLD CELL

Xclent intro to UNION statement. However, how to select all kinds of
underline cells?, i.e. even single/double accounting or simple underlines?

Thanx again

"Mike H" wrote:

Hi

For Each c In ActiveSheet.UsedRange

can be replaced with

For Each c In Selection

Mike

"Mike H" wrote:

Hi,

Try this

Sub Select_Bold()
Dim BoldRange As Range
For Each c In ActiveSheet.UsedRange
If c.Font.Bold Then
If BoldRange Is Nothing Then
Set BoldRange = c
Else
Set BoldRange = Union(BoldRange, c)
End If
End If
Next
If Not BoldRange Is Nothing Then
BoldRange.Select
End If
End Sub

Mike

"FARAZ QURESHI" wrote:

Could one please devise a simple code which would be selecting cells with a
Bold format within a range.

In other words:

For each cell in selection.

Thanx.

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
Alphabetically list of last names: BOLD, not bold Lerner Excel Discussion (Misc queries) 16 March 1st 09 07:46 PM
Alphabetically list of names BOLD and NOT bold Lerner Excel Discussion (Misc queries) 13 March 1st 09 02:37 PM
Bold in a cell Susan Excel Discussion (Misc queries) 2 August 15th 08 03:18 PM
Join bold and non-bold text in one cell bkincaid Excel Discussion (Misc queries) 3 March 21st 06 12:58 AM
How can i test a cell for bold style in a cell (Excel 2003)? Mike A. Excel Worksheet Functions 2 March 6th 06 07:23 PM


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