Copying formula from excel cell A2:O2 and pasting till end of the sheet

Hi I have an excel sheet containing the formula in cell A2:O2 and I have to copy all the formulas and paste till the end of the sheet .
I have tried using copy/paste range, autofill but it did not work.
I don’t wish to use UI interaction.
How that can be done?
Can anyone explain me this?

@Kunal_Jain

May I know what issue are you facing with auto fill ramge…ideallt that shpuld fill till the end

Cheers

Auto Fill Range: AutoFill method of Range class failed
image

This is the error I am getting

@Kunal_Jain

Try using one column each

Like A2 and A3:A1000 and then for B etc

cheers

But autofilling one column each will take time to fill the data with 12k rows
And Also it has columns from A till O
So do we have any other options for this

@Kunal_Jain

If you are using modern then it has another auto fill which can take a range as well, Try that out…

And autofill multiple also should not take time…you can create a loop from A to O and use Autofill inside it…Autofill should not take time even if done for each column…try and check…in debug it might be slow…try with run and excel hidden should be quick enough

cheers

What Loop I must use?

@Kunal_Jain

For loop with Enumerable.Range(1,15).Select(function(x) UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(x)).ToArray

image

and then give range as currentitem + "2" and currentitem + "3:" + currentitem + "1000"

Also make sure to change type argument to string in the for loop properties

Cheers

Can you please help me with the xaml please.
IF possible?

@Kunal_Jain

Hope this helps

cheers

Same Error

@Kunal_Jain

Can you please show a screenshot of how you are using it…is the range wrong or something?

Is it possible to share the file? even dummy data should be good

cheers


Well I cannot share the file But it contains formula for all the 15 columns and all are different

@Kunal_Jain

Sorry My bad…I just saw and it is workign for full range with multipel columns as well…what we are giving wrong is the destination range which should start from the first cell where the formula is present and not the next cell…I just did try it and it is working as expected

So please give the range as "A2:O2" in source and then "A2:O1000" in the destination

image

Hope this helps

cheers