Hi,
Would really appreciate a solution to this problem, having spent hours trying to come up with one and not being able to find one.
situation: I have a and excel table, and in it contains one row of formulas, which I would like to autofill to the last column and the last row. ( so fill across and down)
I cant use range ("AD2: AS2" & lastRow, LastCol) etc because that may not be the last column in the future so I would like to count to the last column and auto fill.
As the formula position or table column where the formula is may also change, instead of using a cell ref - ie AD2, i have select the cell and am starting from active cell.
The code below does work but with two issues
It will only fill accross one line, and by a set number of columns 15
'xxxxxxxxxxxxxxxxxxxxxx
'Find column header
'xxxxxxxxxxxxxxxxxxxxxx
Range("GRIR_Table[[#Headers],[Ageing Catagory]]").Select
Cells.Find(What:="AP Researched by", After:=ActiveCell, LookIn:= _
xlFormulas2, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
'xxxxxxxxxxxxxxxxxxxx
'move down one cell
'xxxxxxxxxxxxxxxxxxxxxxxx
ActiveCell.Offset(1, 0).Activate
'xxxxxxxxxxxxxxxxxxxx
'enter formula
'xxxxxxxxxxxxxxxxxx
ActiveCell.Formula2R1C1 = "=IFERROR(INDEX(ImportTable[[ Researched by]],MATCH(GRIR_Table[@[PO/PO Line]:[PO/PO Line]],ImportTable[[PO/PO Line]:[PO/PO Line]],0)),"""")"
'xxxxxxxxxxxxxxxxxxx
'Fill formula
'xxxxxxxxxxxxxxx
Selection.AutoFill Destination:=Range(ActiveCell, ActiveCell.Offset(0, 15)), Type:=xlFillDefault
'*******************************************************************************************************************************
I have added the count cells / rows from active cell
and tried all the code I can find, but my only results where to apply the same formulas accross the whole cells I want to fill accross given me the exact same data as if I copied and pasted
so now I am well and truly stumped.
This is the only issue that stopping me from completing,
any help would be great
many thanks
Dave
Would really appreciate a solution to this problem, having spent hours trying to come up with one and not being able to find one.
situation: I have a and excel table, and in it contains one row of formulas, which I would like to autofill to the last column and the last row. ( so fill across and down)
I cant use range ("AD2: AS2" & lastRow, LastCol) etc because that may not be the last column in the future so I would like to count to the last column and auto fill.
As the formula position or table column where the formula is may also change, instead of using a cell ref - ie AD2, i have select the cell and am starting from active cell.
The code below does work but with two issues
It will only fill accross one line, and by a set number of columns 15
'xxxxxxxxxxxxxxxxxxxxxx
'Find column header
'xxxxxxxxxxxxxxxxxxxxxx
Range("GRIR_Table[[#Headers],[Ageing Catagory]]").Select
Cells.Find(What:="AP Researched by", After:=ActiveCell, LookIn:= _
xlFormulas2, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
'xxxxxxxxxxxxxxxxxxxx
'move down one cell
'xxxxxxxxxxxxxxxxxxxxxxxx
ActiveCell.Offset(1, 0).Activate
'xxxxxxxxxxxxxxxxxxxx
'enter formula
'xxxxxxxxxxxxxxxxxx
ActiveCell.Formula2R1C1 = "=IFERROR(INDEX(ImportTable[[ Researched by]],MATCH(GRIR_Table[@[PO/PO Line]:[PO/PO Line]],ImportTable[[PO/PO Line]:[PO/PO Line]],0)),"""")"
'xxxxxxxxxxxxxxxxxxx
'Fill formula
'xxxxxxxxxxxxxxx
Selection.AutoFill Destination:=Range(ActiveCell, ActiveCell.Offset(0, 15)), Type:=xlFillDefault
'*******************************************************************************************************************************
I have added the count cells / rows from active cell
and tried all the code I can find, but my only results where to apply the same formulas accross the whole cells I want to fill accross given me the exact same data as if I copied and pasted
so now I am well and truly stumped.
This is the only issue that stopping me from completing,
any help would be great
many thanks
Dave