Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default select all cells with comments in a specified range - two examples

No question here, just some procedure examples for the archive.

Search criteria: select only cells in specified range select only
cells
with comments select cells with comments in specific range
select all comments in specific range select all comments select all
cell comments select comments in subrange comments subset select cells
containing
comments select all cells that contain comments


SELECT CELLS WITH COMMENTS ONLY IN SPECIFIED, TARGETED RANGE


Sub CommentsSelectInSpecificRangeExample1()
'Selects cells with comments in a range already
'named on the activeworksheet. Edit name of target
'range below

Dim TargetRange As Range

On Error Resume Next
Application.Goto Reference:="DATA" 'named range here
Set TargetRange = Selection
TargetRange.SpecialCells(xlCellTypeComments).Selec t

End Sub


Sub CommentsSelectInSpecificRangeExample2()
'Selects cells with comments in a range prompted for
'and selected by user

Dim TargetRange As Range

On Error Resume Next

Set TargetRange = Application.InputBox( _
prompt:="Select Range of
Cells to Select Any Comments Present in the Range", Type:=8)
TargetRange.SpecialCells(xlCellTypeComments).Selec t

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default select all cells with comments in a specified range - two examples

Hi DFFU,

It would probably be advisable to add Error trapping as the SpecialCells
method will complain if no comments exist in the selected range.

---
Regards,
Norman



"DataFreakFromUtah" wrote in message
om...
No question here, just some procedure examples for the archive.

Search criteria: select only cells in specified range select only
cells
with comments select cells with comments in specific range
select all comments in specific range select all comments select all
cell comments select comments in subrange comments subset select cells
containing
comments select all cells that contain comments


SELECT CELLS WITH COMMENTS ONLY IN SPECIFIED, TARGETED RANGE


Sub CommentsSelectInSpecificRangeExample1()
'Selects cells with comments in a range already
'named on the activeworksheet. Edit name of target
'range below

Dim TargetRange As Range

On Error Resume Next
Application.Goto Reference:="DATA" 'named range here
Set TargetRange = Selection
TargetRange.SpecialCells(xlCellTypeComments).Selec t

End Sub


Sub CommentsSelectInSpecificRangeExample2()
'Selects cells with comments in a range prompted for
'and selected by user

Dim TargetRange As Range

On Error Resume Next

Set TargetRange = Application.InputBox( _
prompt:="Select Range of
Cells to Select Any Comments Present in the Range", Type:=8)
TargetRange.SpecialCells(xlCellTypeComments).Selec t

End Sub



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
When entering data into a range of cells, select the entire range. Q Excel Discussion (Misc queries) 0 September 26th 07 04:36 AM
Select Range of Cells programmingrookie Excel Discussion (Misc queries) 2 August 11th 05 07:13 PM
select a range using "cells()" fullers Excel Worksheet Functions 2 July 6th 05 06:00 PM
select from a range only some cells hulub[_3_] Excel Programming 1 September 21st 04 03:14 PM
Adding comments in a range (!) of cells Reinhard F. Bentrup Excel Programming 3 June 9th 04 04:53 PM


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