lady_alina
Board Regular
- Joined
- Feb 18, 2015
- Messages
- 52
Hi,
Here I'm again with another problem... please help me experts..
I have data in column B sheet 1 which is something like this - 123alina09032015 &
I have data in column A sheet 2 which is like this - alina.
The data is huge and keeps adding every month. So what I want is a VBA code to match the words from column A sheet 2 and column b sheet1 and paste it to the adjacent cell in column c of sheet 1
I have a code but that only finds the exact match and pastes it to column c in sheet 1. Here is the code:
Looking forward to your answer.
Here I'm again with another problem... please help me experts..
I have data in column B sheet 1 which is something like this - 123alina09032015 &
I have data in column A sheet 2 which is like this - alina.
The data is huge and keeps adding every month. So what I want is a VBA code to match the words from column A sheet 2 and column b sheet1 and paste it to the adjacent cell in column c of sheet 1
I have a code but that only finds the exact match and pastes it to column c in sheet 1. Here is the code:
Code:
Sub CopyBasedonSheet1()
Dim i As Long
Dim j As Long
Sheet1LastRow = Worksheets("sheet1").Range("B" & Rows.Count).End(xlUp).Row
Sheet2LastRow = Worksheets("sheet2").Range("A" & Rows.Count).End(xlUp).Row
For j = 1 To Sheet1LastRow
For i = 1 To Sheet2LastRow
If Worksheets("sheet1").Cells(j, 1).Value = Worksheets("sheet2").Cells(i, 4).Value Then
Worksheets("sheet1").Cells(j, 3).Value = Worksheets("sheet2").Cells(i, 1).Value
Else
End If
Next i
Next j
End Sub
Looking forward to your answer.
Last edited: