PDA

View Full Version : [SOLVED] unmerge all cells a workbook from another workbook



oam
07-28-2014, 07:03 PM
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.

jolivanes
07-28-2014, 08:36 PM
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

oam
07-29-2014, 01:15 PM
That works great! Thank you for your help.

jolivanes
07-29-2014, 10:21 PM
Glad you're happy with it
Thanks for letting us know