-
Seems to work with some error handling for the merged cells.(Adjust as needed)
(attached sample file)
[VBA]Option Explicit
Sub Find_NONBlank_Cells()
Dim RngTar As Range
Dim RngCur As Range
Dim RngNex As Range
Set RngTar = Range("A2:L20")
Set RngCur = ActiveCell
On Error GoTo MergedCellHandler
Set RngNex = RngTar.Find("*", After:=RngCur, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchDirection:=xlPrevious, SearchOrder:=xlByRows)
On Error GoTo 0
If RngNex Is Nothing Then
MsgBox "No Match found"
Else
RngNex.Activate
End If
Exit Sub
MergedCellHandler:
Set RngNex = RngTar.Find("*", , LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchDirection:=xlPrevious, SearchOrder:=xlByRows)
RngNex.MergeArea.Activate
End Sub[/VBA]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules