Insert column in between 2 columns

Hi All,

Can anyone help me how to insert a column in between 2 columns.
I want to insert a column between ADDRESS and EMAIL. New column name will be DUMP and i need to fill the value 50 to entire column.

AMOUNT column i need to multiply with 100 and write in the same column.

Attaching sample excel below

challenge (4).xlsx (12.5 KB)

@Rreddy

  • Excel Application Scope

    • Read Range (Output: dtExcelData) // Read data into DataTable
  • Assign Activity

    • dtExcelData.Columns.Add(“DUMP”, GetType(Int32)) // Add a new DataColumn named “DUMP”
  • For Each Row (ForEachRow activity)

    • Assign Activity
      • row(“DUMP”) = 50 // Fill the “DUMP” column with the value 50
  • For Each Row (ForEachRow activity)

    • Assign Activity
      • row(“AMOUNT”) = Convert.ToInt32(row(“AMOUNT”)) * 100 // Multiply the “AMOUNT” column by 100
  • Write Range (Output: dtExcelData) // Write the updated DataTable back to Excel

1 Like

Hi @Krishna_Raj thanks. i will try this. I’m looking to skip for each row activity because my data is not constant if i get huge data it may give issue. Let me try this once.

Hi @Rreddy

Please check the attached zip file

BlankProcess1.zip (750.2 KB)

Text File:
Forum.txt (1019 Bytes)

Output File:
challenge (4).xlsx (12.7 KB)

Regards

Hi @vrdabberu thanks for the code. Let me try this. I should use only column name because sometimes names may shuffled. I will try to modify this and I’m using VB. If this works fine i will mark this as solution.

1 Like

Hi @Rreddy

If you don’t want to use more Invoke code activities then try below:


Forum.txt (1.1 KB)
Main.xaml (14.6 KB)

Excel File
challenge (4).xlsx (12.7 KB)

Regards

@vrdabberu thanks for the code. I will check from my end and if all well will mark it as solution

1 Like

AddNew_DataColumn_InBetween.xaml (10.9 KB)

Hey @Rreddy kindly refer the above xaml.Hope you might get your solution
Regards,

Hi @Rreddy ,

please refer :- Activities - Add Data Column

Thanks,
Aman

Thanks @vrdabberu for the code. It’s working but it’s not saving after multiplication. I will fix those as per my request. Thank you…

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