Hi all,
I've looked through the forums but can't seem to find an appropriate example of what I am looking for.
Below is the code from part of a macro I am using to populate cells based on data in 3 sheets:
Dim LR As Long, i As Long
Sheets("Active").Columns("A:B").ClearContents
With Sheets("Terrain")
LR = .Range("K" & Rows.Count).End(xlUp).Row
For i = 4 To LR
With .Range("K" & i)
If .Value <> "" Then
.Offset(, -10).Copy Destination:=Sheets("Active").Range("A" & Rows.Count).End(xlUp).Offset(1)
.Copy Destination:=Sheets("Active").Range("B" & Rows.Count).End(xlUp).Offset(1)
End If
End With
Next i
End With
I need to amend the code to add a second condition to the copy/paste selection so that
If.Value <> "" AND value in column O = "Major" or "Minor" Then
.Offset(, -10) etc
As always help appreciated
I've looked through the forums but can't seem to find an appropriate example of what I am looking for.
Below is the code from part of a macro I am using to populate cells based on data in 3 sheets:
Dim LR As Long, i As Long
Sheets("Active").Columns("A:B").ClearContents
With Sheets("Terrain")
LR = .Range("K" & Rows.Count).End(xlUp).Row
For i = 4 To LR
With .Range("K" & i)
If .Value <> "" Then
.Offset(, -10).Copy Destination:=Sheets("Active").Range("A" & Rows.Count).End(xlUp).Offset(1)
.Copy Destination:=Sheets("Active").Range("B" & Rows.Count).End(xlUp).Offset(1)
End If
End With
Next i
End With
I need to amend the code to add a second condition to the copy/paste selection so that
If.Value <> "" AND value in column O = "Major" or "Minor" Then
.Offset(, -10) etc
As always help appreciated