Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a routine that search for a given number in a range on worksheet. If
the given number if found I want to test for a comment associated with the found cell. My code is returning true for any given number so something is wrong, but I can't seem to figure it out. If anyone has experience with testing for a comment, I'd be very appreciative. My code follows. TIA, Ken Public Function fCellHasComment(lngStoreNumber As Long) As Boolean On Error GoTo PROC_ERROR Dim Cell As Range With ThisWorkbook.Worksheets("Price Groups") For Each Cell In Range("PriceGroupsStoreNumbers") If Cell.Value = lngStoreNumber Then If Cells(Cell.Row, Cell.Column).Comment.Text = "" Then fCellHasComment = False Else fCellHasComment = True End If End If Next Cell End With PROC_EXIT: Exit Function PROC_ERROR: Call ShowError("modUtilities", "fCellHasComment", Err.Number, Err.Description, Err.Source) Resume PROC_EXIT End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Test cell for list data and modify cell contents | Excel Programming | |||
Test a cell for a comment presence from within a macro form 2007 | Excel Programming | |||
copy comment content to cell content as data not as comment | Excel Discussion (Misc queries) | |||
Create Cell Comment based on text in a cell on another worksheet | Excel Discussion (Misc queries) | |||
How can i test a cell for bold style in a cell (Excel 2003)? | Excel Worksheet Functions |