Hi All,
I'm still new to VBA but have since been experimenting with it for a piece of work I'm doing. I'm trying to add a row to the bottom of my table and have succeeded to an extent, however the formula it copies down when it adds the row becomes anchored using the "$" for some reason.
The code is as follows;
SubButton53_Click()
Dim ws As Worksheet
Dim tbl As ListObject
Set ws = ActiveSheet
Set tbl = ws.ListObjects("Table Name")
tbl.ListsRows.Add
End Sub
When I run the Macro it copies all formats and formulas down but it seems to anchor a cell in one of my formulas from;
=IF(ISTEXT(D89),$F$5,"") <----- This is what I wanted to see when the row was added but I got.....
=IF(ISTEXT($D$89),$F$5,"")
Is any one able to tell me whether the VBA code is correct and if not, what could i do instead please?
Many thanks,
Jeevz
Disclaimer: I cannot post the workbook as the data is commercially sensitive.
I'm still new to VBA but have since been experimenting with it for a piece of work I'm doing. I'm trying to add a row to the bottom of my table and have succeeded to an extent, however the formula it copies down when it adds the row becomes anchored using the "$" for some reason.
The code is as follows;
SubButton53_Click()
Dim ws As Worksheet
Dim tbl As ListObject
Set ws = ActiveSheet
Set tbl = ws.ListObjects("Table Name")
tbl.ListsRows.Add
End Sub
When I run the Macro it copies all formats and formulas down but it seems to anchor a cell in one of my formulas from;
=IF(ISTEXT(D89),$F$5,"") <----- This is what I wanted to see when the row was added but I got.....
=IF(ISTEXT($D$89),$F$5,"")
Is any one able to tell me whether the VBA code is correct and if not, what could i do instead please?
Many thanks,
Jeevz
Disclaimer: I cannot post the workbook as the data is commercially sensitive.