Substraction with VBA

G

Guest

Hello,

I need help with a VBA formula that would do "L11" - (minus) "M11" and would
put the result in "N11"
Thanks,
 
F

Frank Kabel

Hi
with activesheet
.range("N11").value=.range("L11").value-.range("M11").value
end with
 
G

Guest

Hi
Is this possible ?
..range("N11:N624").value=range("L11:L624").value-range("M11:M624")
Jeff
 
J

Juan Pablo González

You could use a formula

..Range("N11:N624").Formula = "=L11-M11"

if you don't want to keep the formula put

..Range("N11:N624").Value = .Range("N11:N624").Value

after.
 
F

Frank Kabel

Hi
no. But try the following:
with activesheet.range("N11:N624")
.formulaR1C1="=R[0]C[-2]-R[0]C[-1]"
.value=.value
end with
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top