Range - Formula

  • Thread starter RE: VLOOKUP fORMULA
  • Start date
R

RE: VLOOKUP fORMULA

Any one please help me......?

Is there any way to give a formula to a named range.
for example:-

I have given a name Range1 for D10:D20
I need to give a formula <a1+a2>
and copy the formula to D10:D20

Tks
 
S

Sheeloo

Not sure what you want but try this;
type your name in the address box on the top-left and press enter
this will select the named range
type your formula and then press CTRL-ENTER ... your formula will be copied
to all cells in the range.
 
R

RE: VLOOKUP fORMULA

I am sorry Sheeloo, I was asking for a code

In the below code I have to apply the formula in D10
Range("Range1").FillDown


I was trying to enter a forumla =sum(a1+a2) in all cells (D10:D20) without
applying a formula manually in D10.
 
S

Sheeloo

Try
Range("D10:D20").Select
Selection.Formula = "=SUM(A1+A2)"

Use SUM($A$! + $A$2) if you want Sum(A1+A2) in all cells and not Sum(A2+A3)
and so on
 
R

RE: VLOOKUP fORMULA

I cant define the range as D10:D20, it may vary according to the line
inserted/deleted above.
Is there any other way to define the formula using range name (Range1)?

tks
 
S

Sheeloo

Try
Range(ActiveWorkbook.Names("Range1").RefersToRange.Address).Select
Selection.Formula = "=SUM(A1+A2)"
 

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