Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
For Each cell In Range("E40:E400") '<===== change range to suit
If cell.Value 0 Then Range("N40").Value = "1" End If Next cell -- HTH Bob Phillips (replace xxxx in email address with googlemail if mailing direct) "JohnUK" wrote in message ... Hi The code below is my poor attempt of entering data into one cell depending on data in another cell: Range("E40").Select If ActiveCell 0 Then Range("N40").Select ActiveCell.FormulaR1C1 = "1" Range("E41").Select If ActiveCell 0 Then Range("N41").Select ActiveCell.FormulaR1C1 = "1" Range("E42").Select If ActiveCell 0 Then Range("N42").Select ActiveCell.FormulaR1C1 = "1" Range("E40").Select If ActiveCell 0 Then Range("N40").Select ActiveCell.FormulaR1C1 = "1" and so on and so on............ What I need is a piece of code that does a loop (I guess) that does the same job with a fraction of the code. I know it can be done using formulas on the page, but I am trying to get away from that for the time being. Any help............... Regards John |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
keystroke shortcut needed | Excel Discussion (Misc queries) | |||
shortcut has change or move so this shortcut can not open | Excel Worksheet Functions | |||
Shortcut needed | Excel Discussion (Misc queries) | |||
keystroke shortcut needed | Excel Discussion (Misc queries) | |||
Deleting Rows With Non-Needed Data between Needed Data | Excel Worksheet Functions |