Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
| Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 4th, 2005, 09:55 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default split cells up if merged

Is there any code that will split cells up that have been merged?

I need to do this for a whole workbook at the start of a Sub.

Is this possible?

Thanks.

Picco

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
www.piccosmini.co.uk.tt
www.morton.uk.tt
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
 
Old May 4th, 2005, 10:06 AM
Friend of Wrox
 
Join Date: Jan 2005
Location: Bournemouth, Dorset, United Kingdom.
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Cells.MergeCells = False

cheers
Matt

 
Old May 4th, 2005, 10:12 AM
Friend of Wrox
 
Join Date: Jan 2005
Location: Bournemouth, Dorset, United Kingdom.
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default

alternatively if I slowed down a bit and read the question properly, the answer would have been something more like

myShtCnt = Worksheets().Count
myloop = 1
    Do Until myloop > myShtCnt
        Sheets(myloop).Select
        Cells.MergeCells = False
        myloop = myloop + 1
    Loop


 
Old May 4th, 2005, 10:13 AM
Friend of Wrox
 
Join Date: Jan 2005
Location: Bournemouth, Dorset, United Kingdom.
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Of course I am presuming you don't have any hidden worksheets!

 
Old May 4th, 2005, 10:25 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

Example
This example separates the merged range that contains cell A3.

With Range("a3")
    If .MergeCells Then
        .MergeArea.UnMerge
    Else
        MsgBox "not merged"
    End If
End With



www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
www.piccosmini.co.uk.tt
www.morton.uk.tt




Similar Threads
Thread Thread Starter Forum Replies Last Post
Format Merged Lines edove XSLT 2 August 7th, 2007 05:25 PM
Merged cells when exporting a report to excel bea Reporting Services 0 June 22nd, 2007 09:18 AM
Autofit Merged cells mls Beginning VB 6 1 April 29th, 2006 08:26 PM
Merge and Split Cells in Matrix johnnychow.hike BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 October 25th, 2004 10:17 PM
Wrap text with merged cells aspadda Excel VBA 4 January 29th, 2004 03:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.