I want to print a serial number starting with 001 that is '001 in excel

I want to print serial number starting with 001 and increase as 002,003,004 like this in excel. Suggest a way to get like this.

Hi @Gopi_Krishna1 ,

You can do it as below

Output:
image

Regards,
Vinit Mhatre

If we read and write range in another page means it will be erased right

No, if you enter the N number of series in Sheet1 and then read the sheet1 data and write it to Sheet2, the data that we wrote into Sheet1 will remain the same; if you want to delete the data from Sheet1, use the “Delete range” activity.

Meanwhile reading and writing 001 value has been changed to 1

Hi @Gopi_Krishna1 ,

After Reading , add a single quotation mark (') before each data in the “Column0”, you can use the following LINQ query:

(From row In Final_Dt.AsEnumerable() Let newValue = "'" & row.Field(Of String)("Column0") Select Final_Dt.Clone().Rows.Add({newValue})).CopyToDataTable()

image

Regards,
Vinit Mhatre

After applying this linq I am getting only column0 others columns are missing. Don’t know why.

Hi @Gopi_Krishna1 ,

To include all columns, you need to modify the LINQ query to include all columns. You can achieve this by selecting all fields in addition to "Column0"

(From row In Final_Dt.AsEnumerable()
Let newValue = "'" & row.Field(Of String)("Column0")
Let otherValues = row.ItemArray.Skip(1).Select(Function(x) "'" & x.ToString()).ToArray()
Select Final_Dt.Clone().Rows.Add({newValue}.Concat(otherValues).ToArray())
).CopyToDataTable()

Regards,
Vinit Mhatre

1 Like

Hi @Gopi_Krishna1,

You should be making this change in your excel file using format cells activity. You can add additional zeros if your numbers going to be beyond 999.

image

Demo:
excel increment

Code:

Main.xaml (14.5 KB)

Thnaks,
Ashok :slight_smile:

:smiley: Great its working as expected :+1:

1 Like

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