Desu Nota from Columbus
Well-known Member
- Joined
- Mar 17, 2011
- Messages
- 556
For some reason I can't figure this out...
In a column, I want to select all cells except for Cell1 and insert a formula.
So my range (for column S) is S2:S(infinity).
How do I put this into VB code?
Ive tried the following without success. And if you could explain why what I tried failed, it would help me very much.
and this one (which was a shot in the dark)
And this one too
All of them failed.
In a column, I want to select all cells except for Cell1 and insert a formula.
So my range (for column S) is S2:S(infinity).
How do I put this into VB code?
Ive tried the following without success. And if you could explain why what I tried failed, it would help me very much.
Code:
Columns("S:S").Select
Range("S" & Rows.Count).End(xlUp).Select
Range(Selection, Selection.End(xlUp)).Offset(1, 0).Select
Selection.FormulaR1C1 = "=If(RC[-10]="""","""",(RC[-10]+RC[-9])/3600"
Code:
Range("S2:S65534").FormulaR1C1 = "=If(RC[-10]="""","""",(RC[-10]+RC[-9])/3600"
And this one too
Code:
Range("S2:S65534").Select
Selection.FormulaR1C1 = "=If(RC[-10]="""","""",(RC[-10]+RC[-9])/3600"