Alphabets need to write row by row

If there is value in Company code the Alphabet need to increase even if cross 26 rows the sereies should be
A
B
C
.
.
AA
AB


n

in general we can use and combine the following helpers
grafik

like

oldInt = UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnLetterToColumnIndex(strVarOldName)
strNewName = UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(oldInt + 1)

1 Like

Can you tell me to which that stroldname variable is assigned

e.g from your example:
grafik

it is just about using the different methods to get the Index or the Columnletter

Actually it should write from starting series
like A

As it is a variable / in your control you can let is start from where you want.

Maybe you elaborate more on your use case and share all relevant details on complete base

There is a company code column and it could be unlimited like more that 26 rows
Now we should add series column with the alphabets when value is in company code it should write A
Every new company code we run, we will name with Alphabet series(E.g: A-5001,B-5002,C-5003 and so on).
(If Company codes are more than 26, it will start will series AA-27, AB-28, AC-29 and so on)

we showcased

grafik

we had shown / can post set it e.g. within for each row and using the index + Offset

We assume that at your end it is understood what the both methods are doing. Feel free to share with us your started modelling e.g. as a screenshot or XAML


In B column alphabet series should be write if there is an company code

we can condense to:

grafik
with
grafik
grafik

as idx is 0-based we used +1 for the ColLetter retrieval and +2 as offset for handling that the first row is Header row

It is working Thank you

Hey @Jyothi1

I have used @ppr query in LinQ, without using For Loop.

Use below mentioned LinQ in assign activty:

dt_Output = (
From row In dt_Input
Select dt_Output.Rows.Add({row(0).ToString,UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(dt_Input.Rows.IndexOf(row)+1)})
).CopyToDatatable

Screenshot for your reference:

Workflow Screenshot:

Attaching .xaml for your reference:
ColumnLetter_Sequence.xaml (8.4 KB)

Regards,
Ajay Mishra

In such case it might be better to focus on an entire speed-up and saving processing costs

dt_OutPut - a 1 column only DataTable with the Series Column e.g. prepared with a buold datatable

Assign Activity:
dt_OutPut =

(From i in Enumerable.Range(1, dtDataOrigVar.Rows.Count)
Let s = UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(i)
Select r = dt_OutPut.Rows.Add(new Object(){s})).CopyToDataTable

And using write Range along with a Range offset to B1 to just updating the B Column in Excel

We assume that at your end it is understood what the both methods are doing. Feel free to share with us your started modelling e.g. as a screenshot or XAML

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