View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default how to fill formula in any cell and drag it?

Did you try recoding a macro ?
I got this:

Range("C7").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=SUM(R[-4]C:R[-1]C)"
Range("C7").Select
Selection.AutoFill Destination:=Range("C7:E7"), Type:=xlFillDefault
Range("C7:E7").Select
Selection.AutoFill Destination:=Range("C7:E10"), Type:=xlFillDefault
Range("C7:E10").Select

NickHK

"vumian" wrote in
message ...

hi everyone,

Please help me as following:
- i wanna use VBA to fill automatically a formula in any cell i don't
know before
- then, drag that cell to right 2 cells more
- after that, select 3 cells, drag all of them down to last row - 4,
because amount of rows update frequently. last row of formula is last
row -4.

thanks in advance.


--
vumian
------------------------------------------------------------------------
vumian's Profile:

http://www.excelforum.com/member.php...o&userid=36494
View this thread: http://www.excelforum.com/showthread...hreadid=570009