Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

insert formula vba

Status
Not open for further replies.

HOMMER

Technical User
Apr 12, 2001
112
US
when I select a cell how do i put a formula in that cell???
how do i put a formula here =a1+a2


Sheets("2%M").Select
Range("d42").Select
ActiveCell.FormulaR1C1 = how do i put a formula here
Range("d44").Select
ActiveCell.FormulaR1C1 = how do i put a formula here
 
Here's a couple of descriptions:

"=R[5]C[6]*R[-9]C[-6]"

R[5]C[6]
This means 5 cells down and 6 columns to the right of the selected cell.

R[-9]C[-6]
This means 9 cells up and 6 columns to the left of the selected cell.

R[5]C[-6]
This means 5 cells down and 6 columns to the left of the selected cell.

And you can just enter one line, like this:

Range("A2").FormulaR1C1 = "=R[6]C[1]/R[-1]C[19]" Brainbench MVP for Microsoft Word
techsupportgirl@home.com
 
To specifically address cells:
Code:
Range("A3").Formula = "=A1+A2"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top