Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
When entering data into a range of cells, select the entire range. | Excel Discussion (Misc queries) | |||
Select Range of Cells | Excel Discussion (Misc queries) | |||
select a range using "cells()" | Excel Worksheet Functions | |||
select from a range only some cells | Excel Programming | |||
Adding comments in a range (!) of cells | Excel Programming |