cancel
Showing results for 
Search instead for 
Did you mean: 

How to merge and unmerge cells in EXCEL workbook?

HWXie
Level 3
I want to delete H~I columns in workbook.
Some cells of H~I columns are merged with the cells in J~L columns.
If I select and delete the H~I columns, J~L columns are alse be deleted.

I think maybe I can unmerge the cells, delete H~I columns and then merge the cells again.

I'm now facing another problem that Business Object[MS Excel VBO] has no action that can do merging and unmerging.
So how can I set the robot the merge and unmerge cells in workbook?

regards!
1 REPLY 1

Hi 

You need to create a custom code action to unmerge cells. I'm not sure if the latest version of excel vbo available on Blue prism has the action I think it has a merge action but maybe not a unmerge. I've provided the code below you need to create a new action in the excel vbo, add a code stage then add the following code:

Dim ws As Object

ws = GetWorksheet(Handle, Workbook, Worksheet)

ws.Activate()

ws.Range(Range).UnMerge

The inputs are Handle, Workbook and Worksheet. Hope this helps 🙂