"Write Cell" not putting text in the correct cell

I am trying to put all rows from a data table into a single Excel cell. Is there some sort of “Append Cell” activity which can be used for this?

Otherwise, this is what I’m currently doing (“rowcounter” is my INT32 counter variable)

  1. Declare string variable “string_var” (default value = “N/A”)

  2. Declare Int32 (“rowcounter”). This is my +1 incremented counter variable

  3. Write Cell (“T1” + rowcounter.tostring)
    Writing: string_var + datatable values

  4. Read Cell (“T1” + rowcounter.tostring)
    Output = string_var

While the above DOES put all data table values into a single cell, the cell that it places them into is not (“T1”+rowcounter.tostring). For some reason, it puts the values 10 rows down (“T1”+(rowcounter.tostring + 10))

I’ve been looking over this but cannot see where I’m going wrong. Are there any quick/easy answers to this one?

Thanks!

Hello,

My guess is that it is because you are concatenating a string. Think of it this way, what string would be created from adding “T1” and “1”? Instead of creating “T2” like a number, it would be “T11”. Try Write Cell (“T”+(rowcounter+1).tostring) and see if that fixes the issue. The reason for the +1 is so that all data from the array/data table is captured, but since excel sheets start at the 1st element, not 0, then it enters data into the row+1, 0th row → T1,1st row->T2 exc…

1 Like

You are right @JosephNehl

@SentientPizza please follow this way

Yes, perfect! I can’t believe I didn’t see that before. Thanks!!

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