Apr 12 2024 03:16 AM
I have an excel work book contains with two sheet as Sheet1 and Sheet2. in Sheet1 there is three columns named Column A - Chasis Number , Column B - License ID and Column C - Chasis Number. in column A is filled by some data which is also repeated in Column C. In Column B Column B - License ID is related with Column C. in Sheet2 there is also three Column named Column A - Chasis Number , Column B - License ID and Column C - Chasis Number , but all column is empty. now i want to transfer the all repeated data of Column A and Column C with related data in Column B of Sheet1 to Sheet2
as per column wise as it is with any Excel Formula or VBA Code.
Hope i can get Cooperation from tech community team in this regards
all of Yours Faithfully
TARUNKANTI!1964
Apr 13 2024 12:06 AM
You can achieve this task using VBA code. Below is a sample code that you can use to transfer the data from Sheet1 to Sheet2:
Vba code is untested, please backup your file first.
Sub TransferData()
Dim wsSource As Worksheet
Dim wsDestination As Worksheet
Dim lastRow As Long
Dim i As Long
' Set references to the source and destination worksheets
Set wsSource = ThisWorkbook.Sheets("Sheet1")
Set wsDestination = ThisWorkbook.Sheets("Sheet2")
' Find the last row with data in Sheet1
lastRow = wsSource.Cells(wsSource.Rows.Count, "A").End(xlUp).Row
' Loop through each row in Sheet1
For i = 2 To lastRow ' Assuming data starts from row 2
' Check if the Chasis Number in Column A is equal to the Chasis Number in Column C
If wsSource.Cells(i, 1).Value = wsSource.Cells(i, 3).Value Then
' If they match, transfer the data to Sheet2
wsDestination.Cells(i, 1).Value = wsSource.Cells(i, 1).Value ' Copy Chasis Number
wsDestination.Cells(i, 2).Value = wsSource.Cells(i, 2).Value ' Copy License ID
wsDestination.Cells(i, 3).Value = wsSource.Cells(i, 3).Value ' Copy Chasis Number
End If
Next i
MsgBox "Data transfer complete!", vbInformation
End Sub
Here is how the code works:
Make sure to adjust the sheet names and column references in the code to match your actual worksheet layout. The texts, steps and code were created with the help of AI.
My answers are voluntary and without guarantee!
Hope this will help you.
Was the answer useful? Mark as best response and Like it!
This will help all forum participants.
Apr 13 2024 01:52 AM
Respected NikolinoDE, very much thank You for that You get my point and I have applied the Code Supplied by You but no DATA Transferred to Sheet2, may be I am wrong
With Humble Regards
@TARUNKANTI1964
Apr 13 2024 02:47 AM
Apr 13 2024 03:20 AM
Respected Hans Vogelaar Sir,
actually what that is what I want You may find it which I shared in attached file as sample for Your understanding. ROW number may be extended up to 30000 in every Sheet.
EXCEL 2016
Apr 13 2024 04:04 AM - edited Apr 13 2024 04:20 AM
@TARUNKANTI1964
Respected Sir,
I saw the sample excel file and i have a formula which could help you to extract out the related data in column d and thereby you can paste the said data in the sheet 2 of yours and further i also noticed that there was a chasis number which repeated in the column A with difference License ID and chasis number for that you will get both the license id and chasis number of both the chasis number repeated in the column A.
the formula is =TEXTJOIN("/",TRUE,UNIQUE(FILTER($B$2:$C$101,$A$2:$A$101=C2))) you can ditto the said formula to all the columns and thereby wherever columnA and Coumn C would be matched there would be details of license id from columnB and chasis number from Column C and then you can use =ISERROR(D2) this formula in column E and ditto the same and then to get only repeated data you can use this formula =FILTER(D2:D101,E2:E101=FALSE) in column F and by this you will get the repeated data and after copy pasting it you can delimit the data through "/" by using Text to column feature.
Apr 17 2024 09:31 PM