I have activity to process an excel data into another excel data, but there’s sub header after the header. Take look at the picture below :
My current output right now is header1, header2, header3.
Is there any way for the robot to make the sub header after master Header? (Date today is dd MMM yyyy for example 1 Jul 2022)
Sure. It’s really just a case of writing your date to Row 1, then your Data to Row 2.
Merging the cells takes some more effort, but a little VBA could achieve it.
Save this in a text file, reference it as shown in screenshot above.
Function MergeCells(sheetName, startRow, startCol, endRow, endCol) As String
On Error GoTo ErrorHandler
With Sheets(sheetName).Range(Cells(startRow, startCol), Cells(endRow, endCol))
.HorizontalAlignment = xlCenter
MergeCells = "Success"
MergeCells = "Error: " & Err.Description
You may also need to enable this the first time in Excel (if you’ve never done it before).
- Open Excel and go into File > Options
- Click the Trust Centre tab
- Click Trust Centre Settings…
- Click the Macro Settings tab
- Check the box for Trust access to the VBA project object model
- Click OK
instead of that you can try with pivot table activity
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.