B
BEEJAY
Frequent (large) downloads, into Excel, requires the addition of a column,
that is filled by the use of an "IF" statement.
The following If statement works fine, when tested.
How to get it to work thru all cells, to last row.
Dim lastRow As Long
lastRow = Worksheets(1).Cells(Rows.Count, "C").End(xlUp).Row
Range("F2").AutoFill Destination:=Range("F2:F" & lastRow)
If Range("C2") = "S" Or Range("C2") = "B" Then
Range("F2").Value = Range("D2").Value
Else
Range("F2") = 0
End If
End Sub
If there is a better, more efficient way, please also advise............
that is filled by the use of an "IF" statement.
The following If statement works fine, when tested.
How to get it to work thru all cells, to last row.
Dim lastRow As Long
lastRow = Worksheets(1).Cells(Rows.Count, "C").End(xlUp).Row
Range("F2").AutoFill Destination:=Range("F2:F" & lastRow)
If Range("C2") = "S" Or Range("C2") = "B" Then
Range("F2").Value = Range("D2").Value
Else
Range("F2") = 0
End If
End Sub
If there is a better, more efficient way, please also advise............