View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
mkerstei[_10_] mkerstei[_10_] is offline
external usenet poster
 
Posts: 1
Default Add Formula SumIf Relative Range D = A*


I can't seem to be able to learn how to put macro formulas inside o
spreadsheet formulas! just a last bit of help and this project wil
finally be finished.

Right now I have Column D which is populated with names (i.e. A20004
B33343, etc.) Each name has number data in column F.

I need a macro that:
1. Goes to the last data entry for A, which varies by workbook.
2. Move 3 Rows below that and enters the name "A Article"
3. Moves 3 Columns to the right (Column F) and enters the formula
=Sumif(Column A Data, "=A*", Column F Data)
4. It will then move to the next column on the right and do the same
keeping Column A's data anchored.

This is a bit too complex for my beginner VBA status, any help would b
appreciated. The code I have so far is at the bottom, it should tak
care of objective 1 and 2. Thanks!

Range("d1").End(xlDown).Select
ActiveCell.Offset(rowoffset:=3, columnoffset:=0).Activate
ActiveCell.FormulaR1C1 = _
"A Article"
ActiveCell.Offset(rowoffset:=0, Columnoffset:=3).Activate
COLOR="Red"]ActiveCell.FormulaR1C1 = _
"=Sumif(" & Range("D1").End(xlDown) & ","=A*","
Range("F1").End.(xlDown) & ")"[/color]

Note: The code in red is INCORRECT and needs help

--
mkerste
-----------------------------------------------------------------------
mkerstei's Profile: http://www.excelforum.com/member.php...fo&userid=2568
View this thread: http://www.excelforum.com/showthread.php?threadid=54957