Good Afternoon Folks,
I am trying to play with "find" and "mergearea" in order to better understand vba.
The code i wrote worked for finding a string in a range of merged columns.....but the code is failing in a range of merged rows.
if you see the problem, please hint, but do not give me the answer. I am more likely to remember the solution if i struggle. At
the moment, I have no clue where the struggle should be.
Not quite. I did see that Rng was not created when i looked at it in the "locals" window. I checked the spelling of the term in the string.
Also the Range appears logical to me. i am defining the range as column "C" and including rows 5 to 100.
THIS CODE WORKS
Set Rng = ThisWorkbook.Sheets("Sheet1").Range("D3:AA3").Find("WallComponentOptions")
Debug.Print Rng.MergeArea.Address
THIS CODE FAILS
C
' changing the search to a vertical range of rows in a single column
Set Rng = ThisWorkbook.Sheets("Sheet1").Range("C5:C100").Find("WallBoundary")
Debug.Print Rng.MergeArea.Address
Thank you,
bil
Bookmarks