Based on column 'L' copy column 'D'

GirishDhruva

Active Member
Joined
Mar 26, 2019
Messages
308
Hi Everyone ,

I am trying to copy a cell value of column D based on column 'L' Value

[TABLE="width: 500"]
<tbody>[TR]
[TD]Column-D[/TD]
[TD]...[/TD]
[TD]....[/TD]
[TD]....[/TD]
[TD]Column-L[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]sdf[/TD]
[TD]asdf[/TD]
[TD]asdf[/TD]
[TD]123456[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]sdfdsfsd[/TD]
[TD]dfasdgv[/TD]
[TD]sc[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]asdfasd[/TD]
[TD]asdfas[/TD]
[TD]vsadvwdv[/TD]
[TD]1233456[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]fasdfasdf[/TD]
[TD]sadf[/TD]
[TD]afsadfd[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]asdfasd[/TD]
[TD]fsadf[/TD]
[TD]asdf[/TD]
[TD]1432411[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Can anyone help me how can i do this, in VBA
 
Last edited:

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi Everyone,
Can the above question could be done???? or it cannot be done????.
Could i get some suggestions for that

Thanks in advance
 
Upvote 0
Hi Everyone ,

I am trying to copy a cell value of column D based on column 'L' Value

[TABLE="width: 500"]
<tbody>[TR]
[TD]Column-D[/TD]
[TD]...[/TD]
[TD]....[/TD]
[TD]....[/TD]
[TD]Column-L[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]sdf[/TD]
[TD]asdf[/TD]
[TD]asdf[/TD]
[TD]123456[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]sdfdsfsd[/TD]
[TD]dfasdgv[/TD]
[TD]sc[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]asdfasd[/TD]
[TD]asdfas[/TD]
[TD]vsadvwdv[/TD]
[TD]1233456[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]fasdfasdf[/TD]
[TD]sadf[/TD]
[TD]afsadfd[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]asdfasd[/TD]
[TD]fsadf[/TD]
[TD]asdf[/TD]
[TD]1432411[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Can anyone help me how can i do this, in VBA

Here i am trying with this code but i am not understanding where i should make changes to copy only in between values and paste in sheet2 one below the other
Code:
Sub looping()
Dim lastrow, lastrow1, i, j As Long
lastrow = Cells(Rows.Count, "L").End(xlUp).Row
lastrow1 = Cells(Rows.Count, "D").End(xlUp).Row
For j = 3 To lastrow1
    For i = 4 To lastrow
        If Not Cells(i, 12).Value = "" Then
            Range(Cells(j, 4), Cells(i, 4)).Copy
        End If
    Next i
    Worksheets("Sheet2").Paste
    Worksheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Select
Next j
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,204
Members
453,022
Latest member
RobertV1609

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top