Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
autofill with variables trouble
Hello--I am trying to work a macro using autofill an area with formula
R1C1 using variables. Strangely, I can get the thing to work for rows but not for columns. I am sure I am missing something obvious. Can anybody see what I am doing wrong? distance, rowcount and colcount are all variables dimmed to integers 'set up the R1C1 ActiveCell.FormulaR1C1 = "=R[-" & distance & "]C" 'Autofill ActiveCell.AutoFill _ Destination:=ActiveCell.Resize(rowcount - 4, colcount - 1 ), Type:=xlFillDefault I am banging my head against the wall and would love some help. -Abe |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
autofill with variables trouble
Try recording a macro. If you are trying to fill rows and columns
simultaneously I don't think you can do it that way. You will need to fill ActiveCell across the columns first, then those columns down the rows next, in two steps. (Or down the rows first and across the columns next). " wrote: Hello--I am trying to work a macro using autofill an area with formula R1C1 using variables. Strangely, I can get the thing to work for rows but not for columns. I am sure I am missing something obvious. Can anybody see what I am doing wrong? distance, rowcount and colcount are all variables dimmed to integers 'set up the R1C1 ActiveCell.FormulaR1C1 = "=R[-" & distance & "]C" 'Autofill ActiveCell.AutoFill _ Destination:=ActiveCell.Resize(rowcount - 4, colcount - 1 ), Type:=xlFillDefault I am banging my head against the wall and would love some help. -Abe |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Not at all clear on use of variables and/or object variables | Excel Discussion (Misc queries) | |||
Trouble Graphing 1 point w/ 2 variables | Charts and Charting in Excel | |||
Autofill: Need to autofill one week block, (5) weekday only into cells. | Excel Discussion (Misc queries) | |||
Q. Autofill question: Can I autofill alpha characters like I can numbers? | Excel Programming | |||
I'm having some trouble with variables in Excel '97... | Excel Programming |