How to add new column "Sr. No" with insert serial numbers for rows in excel?


#1

Hi I have an excel file with multiple columns, I need to now insert a column in the beginning with the serial number for the available rows. How this can be done? Please suggest a solution.

Regards,
Komal


#2

Hi @Komal_Joshi,

Use read range activity to get the data to DataTable.
use add data Column activity to add the “S.No” Column -> check the Property AutoIncrement, TypeOf Argument is int32 .
use Write Range activity to write the data into Excel File.

Regards,
Arivu :slight_smile:


#3

Hi, Thanks.
It says Add data column : These columns don’t currently have unique values. Can you please share a xaml file. Please find the excel sheet here. SampleData.xlsx (12.0 KB)


#4

hi ,
please find attached xaml file.Main.xaml (7.1 KB)


#5

tell me if any changes required


#6

Hi Thank you for your reply. How will I be able to insert serial numbers in column Sr. No? Here is the sample Data file I am referring to. Please suggest me the way to print row numbers for the existing rows. SampleData.xlsx (12.0 KB)


#7

what you want in that Sr no column.Its 1,2,3…??


#8

Yes. 1,2,3 numbers upto 100.


#9

OK…give me some time i will provide you that solution


#10

Sure. Thank you… That will be really helpful!


#11

Hi Komal,
Did you get the solution of the above mentioned problem? If so, please share the solution

Regards
Simi


#12

Hi simi,
Please find attached the solution I worked on. Sample.xlsx (8.3 KB)
Sr.No. workaround using hotkeys.xaml (25.5 KB)

Regards,
Komal