Consulting

Results 1 to 4 of 4

Thread: unmerge all cells a workbook from another workbook

  1. #1
    VBAX Contributor
    Joined
    Oct 2013
    Posts
    181
    Location

    Question unmerge all cells a workbook from another workbook

    I would like to know is there a way to unmerge all cell in a workbook from another workbook? I have a report that comes from another database and when exported from the database to Excel some of the cells are merged. I then link the data from the database Excel worksheet to a worksheet containing formulas. By having the cells unmerge the linking process becomes easier.

    Thank you for any help you can provide.

  2. #2
    Is the workbook where the cells need to be unmerged open?

    If it is closed, you could try this. (Change the path and name references as required)
    Sub Maybe()
        Dim wb2 As Workbook
        Application.ScreenUpdating = False
        Workbooks.Open Filename:="C:\Some Folder\TempBook.xlsm"
        Set wb2 = ActiveWorkbook
        wb2.Sheets(1).Cells.UnMerge
        wb2.Close True
        Application.ScreenUpdating = True
    End Sub
    Last edited by jolivanes; 07-28-2014 at 08:50 PM.

  3. #3
    VBAX Contributor
    Joined
    Oct 2013
    Posts
    181
    Location
    That works great! Thank you for your help.

  4. #4
    Glad you're happy with it
    Thanks for letting us know

Posting Permissions

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