ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Count merged cells (https://www.excelbanter.com/excel-discussion-misc-queries/244929-count-merged-cells.html)

jlclyde

Count merged cells
 
I have a form and when it loads I want it to calculate how many merged
cells are in selection.

RnSz = Selection.Cells.MergeArea.Count - is what I thought it shoudl
be but it keeps giving me Application-defined or object-defined
error. I am not sure what this is telling me.

Any help is appreciated,
Jay

jlclyde

Count merged cells
 
On Oct 8, 6:53*am, jlclyde wrote:
I have a form and when it loads I want it to calculate how many merged
cells are in selection.

RnSz = Selection.Cells.MergeArea.Count *- is what I thought it shoudl
be but it keeps giving me Application-defined or object-defined
error. *I am not sure what this is telling me.

Any help is appreciated,
Jay


For those of you who are concerned, I found the answer. My current
selection was through S1:AI9, so I had to resize it first. so it is
now RnSz = Selection.resize(1,1).cells.mergearea.count.

Sorry,
Jay


All times are GMT +1. The time now is 06:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com