Problem with rows and columns in excel automation


#1

Hello,

How to automatically increase row and column count ? I want to fill an excel sheet row wise. In every row, I am getting column values from different tables but I want the data entry in column to be automated. For example using for each row, when row value=1, I want to fill data into column from A1 to M1. Here M1 marks the end of column. Then I want to go to second row automatically and again start filling data from A2 to M2 and so on till I reach the end of some row value (Assume 10th row).

How to I go about?
Do suggest some ideas.

Thanks in advance!!
Tamshi


#2

ExcelPyramid.zip (10.8 KB)

Hi @Tamshi This is similar but not exact…Here it create a pyramid in excel with the value u have entered…Please consider and find there the logic for Row,Column counts with 2 for each loops inner and outer…Inner: Col.count Outer: Row.Count…
Hope it helps u…
:slight_smile:


#3

@tamshi
Instead of filling an excel sheet row wise, you can first build a datatable from the data that is available with you, once you have a complete datatable with you, you can push the complete datatable into an excel sheet.
This will be faster as you will deal with the excel application only once.


#4

Thanks @sankar.kuna for the help!!! Through your workflow now I am able to figure out how I need to go about.


#5

Thanks @Bharat_Kumar for the suggestion. My use case is such that for each cell I am getting the values from different sheet of an excel file. So every time in order to read those data, I need to specify different locations. So data is available in different sheets but I want to write them in a single sheet starting from row1 and proceed cell by cell from A1 to Z1 and so on…