![]() |
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 |
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 |
All times are GMT +1. The time now is 11:41 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com