How to merge the cells and write the value in a row

How to merge the cells and write the value in a row based on the reference of the below row end item

Please share data sample and expected output as the description is too general. Thanks

file.xlsx (10.1 KB)
the headers will be considered from A5 so where the headers will stop from that cell , upper row should be merged(5 cells) and date should be written

@anjani_priya Send a expected output file also so that we will get more clarification!

In attached file itself there is a output sheet

@anjani_priya

Unable to see it!

Regards,
Ajay Mishra

file.xlsx (11.4 KB)
see this file

@anjani_priya Okay Got it solving!

1 Like

hello @anjani_priya ,

You can achieve your goal using VBA code, so you need to use two activities

  1. Excel application scope
  2. invoke VBA

I am attaching a zip file where .xmal and VBA.txt are present. Replace the path with your Excel path.
you will get the desired result

Merge.zip (2.1 KB)

and you have enable macro for your excel below screenshot for your reference

Hope it will help you

Regards,
Dheerendra Vishwakarma

1 Like

Hi @anjani_priya ,

The solution uses only excel based activities and a keyboard shortcut activity.

Please refer the attached workflow.
TestProcess.zip (21.2 KB)

Thanks,
Gautham.

the index should be dynamic , if the column end at h column then from h to -4 columns should be merged and that merged cells

How do you find the last column,is there any particular key word to identify the last column.?

We can do that if we know details of the table structure, a pattern or something that would help us.

If the excel is read from a5 then they will become headers , so upto the headers end , from there -3 cells should be merged

ending column is dynamic

Hi @anjani_priya ,

Please check this flow, It takes the column dynamically as you had asked.
ExcelTestProcess.zip (22.4 KB)

You can modify the Column where the merge starts inside assign activity, Just go through the code I am sure you will understand the logics I have placed.

Thanks,
Gautham.

It’s merging but not writing the date there
Capture96
b3 cell date should write in the merged cells

That is because tou said -3 cells.

Change that to -4 and it will work fine. I mentioned that in my response. You just need to adjust that number in the mergestartcell assign activity.

Try and let me know.

Thanks ,
Gautham.

Yeah I have tried but iam not getting the date there

there is no write cell or write range in the code

Okay, use a read cell activity to read from B3.

And use a write cell activity to write in

MergeStartCell +β€œ4”

Before the select range activity.

This way you will get the date in the merged cells.

1 Like

image
see this