xcode - Excel VBA code for simple formula between cells -


enter image description here

i need code these orders:

  1. go first blanks cell in column c.
  2. calculat number in column d minus 14 , long there number right cell in d (there blanks in column d)
  3. 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

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -