Results 1 to 2 of 2

Thread: VB for Excel - auto detect merged cells?

  1. #1
    Member
    Join Date
    Mar 06
    Posts
    36

    VB for Excel - auto detect merged cells?

    I have an excel spreadsheet with many rows and columns. I'm trying to sort all the columns but I get there error that merged cells exist and must be the same size.

    Is there a way to either automatically un-merge cells, or at least scan the workbook for the location of the merged cells?

    Thanks! Dan

  2. #2
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 01
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    59,465

    Re: VB for Excel - auto detect merged cells?

    You may have to loop through the cells in that column but this will determine a boolean of if its a merged cell.
    VB Code:
    1. [i]range or cell object.[/i]CellFormat.MergeCells
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (VBA, VB 6, VB.NET, C#)
    Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Star Wars Gangsta Rap Reps & Rating PostsVS.NET on Vista (New)Multiple .NET Framework Versions (New)Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel Core 2 Extreme Ed., 2 WD Raptor 10K RPM 150 GB HDs RAID 1, 2 GBs DDR2 667 MHz RAM, 3 Viewsonic 17" LCDs, Windows Vista RTM, IE 7, Office 2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •