How to Write range without Specifying Cell Numbers

Generally in the Write Range Activity We Specify the Range as

A1:D5, This specifies that data can be pasted starting from Cell A1 To D5 The Moment it reaches D6 there will be an Error

Is there a Way That we can Do Something Like This :

A:D, In this case there will be absolute no Problem because no cell Numbers are specified Here

Hi @Ishan_Shelke,

If you want to read/write a specific range here, you should use the read/write range activity. Since the main purpose of the cell reading/writin activity is to read/write a specific cell, it expects row and column numbers from you.

Regards,
MY

1 Like

Thanks For you Reply

I have a Situation Like

Sometimes My Datatable has data like this :

image

and sometimes it looks like this :

image

My motve of saying is THe Number of Rows are not constant in my case so If I Specify a range in the write range activity My program can fail

Hey @Ishan_Shelke,

Instead of specifying in the write range activity as “A1:D5”, specify it as “A1” it will write all the data and start writing it from A1 cell.

Thanks,
Sanjit

1 Like

we can calculate the Range Information in advance e.g. DataTableVar.Rows.Count

As mentioned above, with an A1 B1, LetterDigit Range we are driven by the datatable used for the writing and can restrict it also before writing to Excel

1 Like

Thanks for your Reply. I have situation Where I have to paste the data from only Column A to Column D, This is where I am getting Stuck

Hey @Ishan_Shelke,

Can you brief about you datatable means how many columns are there.

Thanks,
Sanjit

1 Like

In May case There are 12 Columns

And I want to paste the Datatable into another sheet between Column D to Column O. The Number of Rows keep on Changing every time the bot runs

Hey @Ishan_Shelke,

Number of rows does not cause any error, if you have a datatable having 10 rows and 3 columns you can write it from cell “A1” on the other hand if you would be having 100 number of rows and 3 columns still you can write it on cell “A1”

The end range is not required, you have to give only the initial point.

Thanks,
Sanjit Pal

1 Like

Thanks @Sanjit_Pal You were Right I was just getting Confued here.

1 Like

Thanks Everyone For All all your replies. Much Appreciated.

Hi @Ishan_Shelke,

Understood. A tip on the subject has also been given above. To be more descriptive, follow the steps below.

1-First of all, read your entire input excel without specifying a range and assign it to a table (dt)

2-Extract the data you want by specifying the range you want to read. In the first case, the number of rows of the table you are reading will give you the dynamics of the cell size.

3-Do the printing process by specifying the excel you want to move your range table that you extracted to the table.

Regards,
MY

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.