Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determining number of columns a cell is merged across (XLS)

Status
Not open for further replies.

Bengreen

Programmer
Dec 8, 2009
5
GB
I have a set of Excel spreadsheets which all have similar properties and I'm trying to automate a set of processes on them.
I'm a compelte VB beginner, but it's going ok - I've just hit a stumbling block which the internet isn't being very helpful with.
Once I have found a certain cell, is it possible to determine how many columns it is merged across?
Many thanks for any help!
 



Hu,

Check out the MergeArea Property.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 


more specifically...
Code:
msgbox cells(1,1).mergearea.columns.count
to determine the number of columns merged with cell A1.


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Checked it out. Works a treat.
Many thanks, and excuse the n00b :)
 



n00b is never something to appologize for.

Glad we could help.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top