Merged cells are paid in the a**. The only way I can get to work this code is:
First unmerge cells, find the value (Address) and then once you are done, you can re-merge them.
Option Explicit
Sub cellfind()
Dim dws As Worksheet
Dim r As Range, acell As Range
Dim dte As String
Dim thismth As Date
Dim thisyr As Date
Dim dlastrow As Long
thismth = Month(Date)
thisyr = Year(Date)
Set dws = Sheets(1)
dlastrow = dws.Cells(Rows.Count, "B").End(xlUp).Row
Set r = dws.Range(dws.Cells(1, 1), dws.Cells(dlastrow, 2))
Debug.Print dws.Cells(1, 1).Value
Debug.Print r.Address
With Columns("A:B")
Range(.Cells(1, 1), .Cells(1, 2)).UnMerge
Set acell = .Find(What:="2015", LookIn:=xlValues, LookAt:=xlWhole)
If Not acell Is Nothing Then
Debug.Print acell.Address
End If
Range(.Cells(1, 1), .Cells(1, 2)).Merge
End With
End Sub
Bookmarks