I've been researching thisbut none of the answers I found seemed to make sense in what I am doing.
I have the following code:
' find last row
findlastrow = Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row
lastrow = findlastrow
lastrow = lastrow - 1
' set totals row
totalrow = lastrow + 1
' Sum purchases, international, roaming and other charges and credits
Columns("R:R").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("R1").Select
ActiveCell.FormulaR1C1 = "Other Chgs & Creds"
Range("R2").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-4]:RC[-1])"
Range("R2").Select
Selection.AutoFill Destination:=Range("R2:R" & lastrow), Type:=xlFillDefault
Range("R2:R" & lastrow).Select
Columns(17).EntireColumn.Delete
The "Sum Purchases inserts a column after collumn Q and then runs a formula to total columns N-Q.
I need to convert the column with formula (column R) to values so when I delete N-Q the totals will be there.
i wrote this about 3 years ago and havent done much scripting since so I get lost easliy. Any help mucj appreciated.
I have the following code:
' find last row
findlastrow = Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row
lastrow = findlastrow
lastrow = lastrow - 1
' set totals row
totalrow = lastrow + 1
' Sum purchases, international, roaming and other charges and credits
Columns("R:R").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("R1").Select
ActiveCell.FormulaR1C1 = "Other Chgs & Creds"
Range("R2").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-4]:RC[-1])"
Range("R2").Select
Selection.AutoFill Destination:=Range("R2:R" & lastrow), Type:=xlFillDefault
Range("R2:R" & lastrow).Select
Columns(17).EntireColumn.Delete
The "Sum Purchases inserts a column after collumn Q and then runs a formula to total columns N-Q.
I need to convert the column with formula (column R) to values so when I delete N-Q the totals will be there.
i wrote this about 3 years ago and havent done much scripting since so I get lost easliy. Any help mucj appreciated.