Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Increase
Is there a code that will scan every even cell in column F for a quantity and
if it finds a quantity it will add a 1 to the quantity? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Increase
Dim lR As Long
With Sheets("Sheet1") For lR = 1 To .Cells(.Rows.Count, "F").End(xlUp).Row If WorksheetFunction.IsNumber(.Cells(lR, "F")) And _ Not .Cells(lR, "F").HasFormula Then .Cells(lR, "F") = .Cells(lR, "F") + 1 End If Next End With -- Regards, Nigel "Workbook" wrote in message ... Is there a code that will scan every even cell in column F for a quantity and if it finds a quantity it will add a 1 to the quantity? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Increase
The OP wanted to add one to only the even rows (he said "even cells", but
that is what I think he meant), so the loop counter should start at 2 and Step 2 needs to be added to the end of your For statement... Dim lR As Long With Sheets("Sheet1") For lR = 2 To .Cells(.Rows.Count, "F").End(xlUp).Row Step 2 If WorksheetFunction.IsNumber(.Cells(lR, "F")) And _ Not .Cells(lR, "F").HasFormula Then .Cells(lR, "F") = .Cells(lR, "F") + 1 End If Next End With -- Rick (MVP - Excel) "Nigel" wrote in message ... Dim lR As Long With Sheets("Sheet1") For lR = 1 To .Cells(.Rows.Count, "F").End(xlUp).Row If WorksheetFunction.IsNumber(.Cells(lR, "F")) And _ Not .Cells(lR, "F").HasFormula Then .Cells(lR, "F") = .Cells(lR, "F") + 1 End If Next End With -- Regards, Nigel "Workbook" wrote in message ... Is there a code that will scan every even cell in column F for a quantity and if it finds a quantity it will add a 1 to the quantity? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Number in cell increase with increase in font size. | Excel Discussion (Misc queries) | |||
HELP - 5% INCREASE | Excel Worksheet Functions | |||
percentage increase | Excel Worksheet Functions | |||
price increase to always end in 9, i.e. 1.99 | Excel Discussion (Misc queries) | |||
Increase A2 by 15% | Excel Discussion (Misc queries) |