Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
the column you use to find the last row must be a column that contains data
in the last row. You picked column C in this case. Most worksheets have a least one column that is always contains data. problems occur if you have columns where there isn't data in every row. "BEEJAY" wrote: 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............ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Fill Color If Statement | Excel Worksheet Functions | |||
How to fill a cell using an IF statement | Excel Discussion (Misc queries) | |||
How do you Control the fill color using an if statement formula? | Excel Worksheet Functions | |||
How to fill a column with color in statement | Excel Programming | |||
Fill an Indirect Statement | Excel Discussion (Misc queries) |