I have a table that is used to manipulate quotes containing our cost. It starts as a blank table that we paste in worksheet that we get from the vendor. Our table has additional columns that contain saved formulas, so they are applied to the new vendor data each time we start a new quote.
I want to be able to reset a particular column to it's original formula, something I can easily do with the "Restore to Calculated Column Formula" in the error checking feature.
I would love to be able to trigger that feature from within VB, but if I cannot I have written a simple module that loops row by row and inserts the formula into the specific column.
Problem is, I cannot get it to run.
The formula originally in the cell is:
The module looks like this:
What are my options to make this work?
Thanks
I want to be able to reset a particular column to it's original formula, something I can easily do with the "Restore to Calculated Column Formula" in the error checking feature.
I would love to be able to trigger that feature from within VB, but if I cannot I have written a simple module that loops row by row and inserts the formula into the specific column.
Problem is, I cannot get it to run.
The formula originally in the cell is:
Code:
=[@
[List Price]]*1-[@
[List Price]]*[@[% OffList]]
The module looks like this:
Code:
Sub OffList()
Sheets("Pricing").Select
Dim x As Single
Dim r_Count As Long
Dim MyTable As ListObject
Dim MyWorksheet As Worksheet
Set MyWorksheet = ActiveWorkbook.Worksheets("Pricing")
Set MyTable = MyWorksheet.ListObjects("QuoteLines")
x = 2
r_Count = MyTable.DataBodyRange.Rows.Count + 1
Sheets("Pricing").Select
Do While x <= r_Count
Cells(x, 18).Formula = [@
[List Price]] * 1 - [@
[List Price]] * [@[% OffList]]
x = x + 1
Loop
End Sub
What are my options to make this work?
Thanks