gsinkinson
New member
- Joined
- Jul 11, 2017
- Messages
- 1
- Reaction score
- 0
- Points
- 1
I am working with a table with several columns of numbers:
I want to add several more columns to hold various calculations.
I can add a new blank column with VBA using:
Sub AddNext()
' Add new column to table
Dim ws As Worksheet
Set ws = ActiveSheet
ws.ListObjects("Table1").ListColumns.Add
End Sub
I would like to rename the column header in E1 to Rng,
add a calculation in E2 of =D2-A2,
I can add the calculation with the following but I don't
know how to rename the column header for column E:
Sub AddRng()
' Add number range to table
Range("E2").Select
ActiveCell.FormulaR1C1 = "=RC[-1]-RC[-4]"
End Sub
Then, I'd like to convert the formulas in column E to values.
I then will add more columns and calculations and convert them to values.
Can anyone provide the simplest way to rename the column header,
and then convert formulas to values?
I want to add several more columns to hold various calculations.
I can add a new blank column with VBA using:
Sub AddNext()
' Add new column to table
Dim ws As Worksheet
Set ws = ActiveSheet
ws.ListObjects("Table1").ListColumns.Add
End Sub
I would like to rename the column header in E1 to Rng,
add a calculation in E2 of =D2-A2,
I can add the calculation with the following but I don't
know how to rename the column header for column E:
Sub AddRng()
' Add number range to table
Range("E2").Select
ActiveCell.FormulaR1C1 = "=RC[-1]-RC[-4]"
End Sub
Then, I'd like to convert the formulas in column E to values.
I then will add more columns and calculations and convert them to values.
Can anyone provide the simplest way to rename the column header,
and then convert formulas to values?