I’m currently working on a workflow to copy an account number and paste in an application to see whether the account number is found or not.
For copying the account number, I’ve used “for each row” activity to loop through my list (column B) in an excel.
So now, the question is - how do I update back in the excel (column A) as “complete” (if the account number found) or “pending” (if the account number not found) for respective account number’s row in the excel?
When you are going through your for each are you storing the row number in any form? This could be an arbitrary number that you increment each time you go through the loop and use as the row number in a write cell to write back to column A.
intRowNum = 2 (default row)
for each row in DataTable
\Do whatever you need to do. including some logic to say whether the it is found or pending.
irownum = irownum+1
Great! Its working. Thank you so much for your great guidance.
However, the cell was updated starting from row 1 (which is my header).
Is it possible to write starting from row 2 just exactly as the same row where the respective account number are?
Hope you could help.
I am writing some string array getting from regular expression in excel.But each time I want to increase row no. in same column.But after updating some cells script get stopped. Can you please provide me the solution.
I am trying to print the data of a row one by one. For this I have used a Do-While loop. But while executing the same, the values are getting printed in required Format. But at the end it is throwing an exception like I haven’t initialized the Object instance. Uploading the xaml file and the screenshot of exception. Could anyone pls help me out. Thanks in advance. Main.xaml (7.9 KB)
Thank you…This is really helpful. But what if we have to increment the cells in single row…i.e., to move from left to right in the same row. Then the index will increment in this way right?? A1, B1, C1…
Any solution to print the row values one by one as you have mentioned for columns.
The first problem i can see with your Write Cell value you are using “C1”+Counter.ToString() so it is writing in a cell address C11,c12 and so on.
So just use like “C”+Counter.ToString()
and one other thing -
if you are using RowIndex of Datatable as a counter then keep in mind it will always get start from index 0 so you have to increase your counter value on each iteration by 2 ( because one for making address to take and one to skip to write in header cell )