xcode - Excel VBA code for simple formula between cells -
i need code these orders:
- go first blanks cell in column c.
- calculat number in column d minus 14 , long there number right cell in d (there blanks in column d)
- copy result in column c , paste values column b. note: need stay in original rows.
` op_wb.sheets("optic main").activate dim firstrow range dim lastrow range set firstrow = range("c1").end(xldown).offset(1, 0)
range("e1").end(xldown).offset(0, -2).select range(firstrow, lastrow).formular1c1 = "=(c4-14)"`
try this:
1.
set firstrow = range("c1").end(xldown).offset(1, 0) set lastrow = range("e1").end(xldown).offset(0, -2) range("e1").end(xldown).offset(0, -2).select 2.
range(firstrow, lastrow).formular1c1 = "=(c4-14)" 3.
selection.autofill destination:=activecell.range("a1:a" & lastrow) hope helps

Comments
Post a Comment