Storing "n" number of rows in a variable and pasting(type into) (the whole column) in a web page field

Hi,

My Range has “n” number of columns as header.
Under each header I have ‘n’ number of multiple rows.

How to put all the rows under any header into one Dynamic Variable, in order to paste that bunch of rows in a webpage field?

Number and name of columns and rows are not specified.
And if i loop through each row then it might take some time.
I want all the rows (excluding header)in a column to be pasted in a webpage.

Hi @Bhanu_Rathore,

One way is to select the contents of the entire column (from Row 2, to exclude the header) and do a Ctrl+C to copy it to clipboard.
And then use Clipboard activity to paste that content of the clipboard as a single blob text into the webpage field.

I presume your source is Excel? If yes, the challenge is to see if Excel has a short cut that will allow you to select the contents of the entire column.

How to select all the rows under a header? and the loop it until the last header. Yes im working on excel.

Sheet look like this.

If your column data has no gaps, this is how you do it:

  • Select the cell one row below your header of any column. Example A2
  • Then do Ctrl + Shift + Down Arrow .
  • The full content of the column will be selected
  • The next step is basically do a Ctrl+c to copy the entire content into clipboard
  • Once you have it on the clipboard you can manipulate the text with string operations or paste it directly into the web form.

Now, how do you know how many columns you have to do this for?

For that you don’t have to read the entire sheet into memory. Simply read the first two rows of the datasheet (input range A1:Z2) into a DataTable. If your columns are fixed then you read from A1:E2.
Obviously the DataTable will be loaded only with columns that are populated .
In this case it is from A thro’ E based on your screen shot

The DataTable.Columns.Count can be used to determine the number of columns. Example in this case, the value is 5. So you repeat the copy column steps from A through E.

Hope this gets you started.

The column number and row numbers are not fixed. This sheet is just an example as an outlay.
Columns can go beyond Z and same with rows.

How I do it manually:

  • I copy the whole column one by one excluding the header (ex: A, B, C… till ‘n’ Columns)
  • (In the screen shot i have selected only one column.)
  • Then paste all the cells under the header in a webpage.

I have have created a bot for this which can perform this task but it pastes only one row item at a time. Ex: It will paste: A2 then A3 then A4 and so on. Then it loops through column and pastes B2 then B3 then B4…

Each header acts as a web link for me. I just concatenate the cell value. For example in A1 cell :

xyz.com/df/2332019 (A1 cell value)

So when the BOT loops through each column, it opens a new webpage, where the corresponding values (rows under the header) need to be pasted. So each header acts as a a weblink (for reference i have hyperlinked it).

Hope you get the whole picture.