97
Views
11
Comments
Solved
[Advanced Excel] How to copy rows of excel
Question
advanced-excel
Service icon
Forge asset by Carlos Freitas

I am having a complex excel format

Here is the reference screenshot:-

I want to copy from row number 4 - 12 to 13 -21.

Can someone help with this?

I don't find any relevant action in advance excel

2025-09-25 22-50-38
Hanno
Solution

Hi Krunal

The latest version (2.2.18) now supports copying rows.

There is a new action Worksheet_CopyRows.

You need to pass as parameters:

  1. The Worksheet
  2. Range start
  3. Range end (or the target range)

In your example RangeStart = "A4:A12" and RangeEnd = "A13:A21"

Hope this helps :) 

Hanno

2021-07-14 10-21-07
Krunal Vyas

Thanks Hanno.

Will try this

2021-07-14 10-21-07
Krunal Vyas

Hello @Hanno ,


I tried this and it helps me to a extend.

But what parameter should I pass to copy a whole row?

Not like A2 or something.

But maybe copy row 2 to row 5

So it copies whole row


2025-09-25 22-50-38
Hanno

Hi Krunal

To copy a whole row, you would use, in your example, RangeStart = "2:2" and RangeEnd = "5:5"

To copy a whole column, you would use, for example, RangeStart = "C:C" and RangeEnd = "G:G"

Hope this helps.

Hanno

2021-07-14 10-21-07
Krunal Vyas

Thanks Hanno

That really helps

Let me give it a shot

2023-12-16 19-57-03
Sanjay Kushwah

Hi @Krunal Vyas,

You can use to read Cell_Read Action to read the value of a cell inside excel file and then Write that value into your desired cell in excel.


Cell_Read action

Cell_Write Action


Hope this will help you.

Kind Regards,

Sanjay Kushwah

2021-07-14 10-21-07
Krunal Vyas

Hello Sanjay,

Thanks for the suggestion, But we want to copy the entire row.

Here going cell by cell is very long process as well as we want to preserve formating.


Any other suggestion?

2025-09-25 22-50-38
Hanno

Hi Krunal

Copying a row or a range isn't currently supported, but it looks like the code isn't too complex to add to the extension.

Hanno

2023-05-08 05-34-05
Piyali Saha

Hi Krunal Vyas, 

As mentioned by Sanjay Kushwah, we can follow the similar approach to achieve your usecase. I know it is a bit time taking to read and write by each cell but till we get some method to apply to the range of cell we can follow this approach. So hereby I am attaching the link to test the copy rows of excel functionality.

Here is the link to the demo.

You can find the implementation part in the Forge component of Advanced excel demo.

Regards,

Piyali Saha

2023-12-16 19-57-03
Sanjay Kushwah

your demo asking for login, please anonymous it. 

2023-05-08 05-34-05
Piyali Saha

I have marked it as anonymous please try again now.

2025-09-25 22-50-38
Hanno
Solution

Hi Krunal

The latest version (2.2.18) now supports copying rows.

There is a new action Worksheet_CopyRows.

You need to pass as parameters:

  1. The Worksheet
  2. Range start
  3. Range end (or the target range)

In your example RangeStart = "A4:A12" and RangeEnd = "A13:A21"

Hope this helps :) 

Hanno

2021-07-14 10-21-07
Krunal Vyas

Thanks Hanno.

Will try this

2021-07-14 10-21-07
Krunal Vyas

Hello @Hanno ,


I tried this and it helps me to a extend.

But what parameter should I pass to copy a whole row?

Not like A2 or something.

But maybe copy row 2 to row 5

So it copies whole row


2025-09-25 22-50-38
Hanno

Hi Krunal

To copy a whole row, you would use, in your example, RangeStart = "2:2" and RangeEnd = "5:5"

To copy a whole column, you would use, for example, RangeStart = "C:C" and RangeEnd = "G:G"

Hope this helps.

Hanno

2021-07-14 10-21-07
Krunal Vyas

Thanks Hanno

That really helps

Let me give it a shot

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.