Copy particular from a cell and paste in in other cell

I have below example excel sheet with me .
i am want below result.
how can i do this?

Everytime it contains 3char and 3digits correct?

Hi @Hemant_Deshmukh ,

Try below workflow, hope it work for you (8.9 KB)

Vinit Mhatre

Hi @Hemant_Deshmukh

→ Use the read range activity and store the data in a variable say dt.
→ Use the for each row in data table and the loop the table.
→ Use the assign activity and assign the dt1 = dt.Clone()
→ Use assign activity within the For Each Row in Data Table

Input = CurrentRow(1).ToString

place an if condition after the assign activity and pass the codition as:


In then sequence give assign as below

CurrentRow(0) = System.Text.RegularExpressions.Regex.Match(Input,"[A-Z]+\d+").Value

Use the add data row activity after the if condtion and pass the row field as


In the data table field pass the dt1

at last after the for each row in data table use the write range activity and pass the excel file name and sheet name as required. Later pass the dt1 in data table field.


it could be 3 char and 3 digits or 7digit like 0214754

Hey @Hemant_Deshmukh

Please find the updated workflow it will help you achieve your automation

Main.xaml (17.5 KB)

Sreejith S S

HI @Hemant_Deshmukh ,

Try the attached process; if you have any questions, you can ask anything; if it works for you, mark it as a solution; it will help others as well.

Vinit Mhatre

Hi @Hemant_Deshmukh

→ Read Range Workbook (Remove Add Headers option in Properties)
Output-> dt
→ Use below code in Invoke Code

Dim modifiedDataTable As DataTable = YourDataTable.Clone() ' Create a clone of the original DataTable without headers
modifiedDataTable.Columns.Add() ' Add a new column for the account number

Dim currentAccountNumber As String = "" ' Variable to hold the current account number

For Each row As DataRow In YourDataTable.Rows
    Dim match = System.Text.RegularExpressions.Regex.Match(row(0).ToString(), "([A-Z]+\d+)")
    If match.Success Then
        currentAccountNumber = match.Groups(1).Value ' Extract the current account number
        modifiedDataTable.Rows.Add(currentAccountNumber, row(0)) ' Add a new row with the "account no :" line
        modifiedDataTable.Rows.Add(currentAccountNumber, row(0)) ' Add a new row with the current account number
    End If

YourDataTable = modifiedDataTable

Invoked Arguments:

→ Use Write Range Workbook

Check the below zip file (154.9 KB)

Happy to help if you have any queries

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