Excellearnerva
New Member
- Joined
- May 9, 2014
- Messages
- 7
I am hoping that you can help.
I have set up a range of cells and want to be able to carry out a Range.Find on these cells to identify cells with a particular value.
However I want to be able to find the cell even if it is hidden.
At the moment, my code works perfectly IF the cell is visible, however ProductRange returns Nothing when the cell is hidden.
Any idea why ?
.....
Set ProductRange = Range("DataRange").Find(Range("DataRange").Cells(1, CheckingCell.Column).Value, , xlValues, xlWhole, xlByRows, xlNext, True)
If Not ProductRange Is Nothing Then
CheckingString = ""
FirstAddress = ProductRange.Address
Do
CheckingString = CheckingString & Range("DataRange").Cells(CheckingCell.Row, ProductRange.Column).Value
Set ProductRange = Range("DataRange").FindNext(ProductRange)
Loop While Not ProductRange Is Nothing And ProductRange.Address <> FirstAddress
End If
.....
I have set up a range of cells and want to be able to carry out a Range.Find on these cells to identify cells with a particular value.
However I want to be able to find the cell even if it is hidden.
At the moment, my code works perfectly IF the cell is visible, however ProductRange returns Nothing when the cell is hidden.
Any idea why ?
.....
Set ProductRange = Range("DataRange").Find(Range("DataRange").Cells(1, CheckingCell.Column).Value, , xlValues, xlWhole, xlByRows, xlNext, True)
If Not ProductRange Is Nothing Then
CheckingString = ""
FirstAddress = ProductRange.Address
Do
CheckingString = CheckingString & Range("DataRange").Cells(CheckingCell.Row, ProductRange.Column).Value
Set ProductRange = Range("DataRange").FindNext(ProductRange)
Loop While Not ProductRange Is Nothing And ProductRange.Address <> FirstAddress
End If
.....