[英]If with copy paste in last row
In my excel sheet i want to copy the data from last row/same row of column EKM AF AI, if a condition is met in column AF =Concrete and paste it another sheet in different location在我的 excel 工作表中,我想从 EKM AF AI 列的最后一行/同一行复制数据,如果在 AF =Concrete 列中满足条件并将其粘贴到不同位置的另一张工作表中
Dim FinalRow As Long
LR = lastrow
LR = Worksheets("MASTER LOG-1").Range("AF" & Rows.Count).End(xlUp).Row
If LR = "concrete" Then
Worksheets工作表
Dim FinalRow As Long
LR = lastrow
LR = Worksheets("MASTER LOG-1").Range("AF" & Rows.Count).End(xlUp).Row
If LR = "concrete" Then
Worksheets工作表
if a condition is met in column AF =Concrete then copy data from same row of match in column E,K,M,AF,AI如果在 AF =Concrete 列中满足条件,则从 E、K、M、AF、AI 列中的同一行匹配复制数据
This should help you well underway.这应该可以帮助您顺利进行。
Sub Copy_Concrete()
Dim lastr As Integer
lastr = Worksheets("MASTER LOG-1").Range("AF" & Rows.Count).End(xlUp).Row 'determine last row of column AF
If Worksheets("MASTER LOG-1").Range("AF" & lastr) = "Concrete" Then 'If lastrow of AF = concrete then
Worksheets("Some other sheet").Range("Your range").Value = Worksheets("MASTER LOG-1").Range("Whichevercolumn", lastr).Value 'Set whichever range on another sheet to the value on the same row whichever column of your match.
End If
End Sub
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.