Make Values from formulas

  • Thread starter Thread starter GregR
  • Start date Start date
G

GregR

I have a spreadheet that has a column, titled "Running Totals". This
column moves each month after the first of the month. When I move that
column, I want to automatically convert any formulas to the left of the
column into their numeric value. How? TIA

Greg
 
Select all columns to be updated
Edit>Copy
Edit>Paste special check Values

HTH
 
this may do it all for you since it copies the last column to the next
column and then converts the formulas in the previous last column to values

Sub valuelastcoltonest()
lc = Cells(1, Columns.Count).End(xlToLeft).Column
Columns(lc).Copy Columns(lc + 1)
Columns(lc).Value = Columns(lc).Value
End Sub
 
Use "Paste Special" and select "Values". To convert this to VBA, record
it in the Macro Recorder and copy and paste the code produced.
 
try something like this

Sub example()

Dim first As Integer

Worksheets("Sheet3").Activate

Range("A1").Select

first = 1

Do While ActiveCell.Offset(0, first).Value <> "Running Totals"
first = first + 1
Loop

Columns(first).Select

Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Application.CutCopyMode = False

Range("A1").Select

End Sub

you would have to run this every month. this assumes that the sheet is
called "sheet3" so you would have to change that appropriately. It also
assumes the heading is in row 1 so if it is not, you have to change the 0 in
Do While ActiveCell.Offset(0, first).Value <> "Running Totals" to 1 or 2 or
whatever depending on which row in is in.

hope that helps
 
Don, the running total column is not the last column. I need something
to find the running total column, count the columns to the left of it,
however omit column "A", and convert any formlas into values. TIA

Greg
 
Sean, if I wanted to skip Column "A", would I select B1. Your other
assumptions are correct, except it is always the first sheet in the
workbook.
 
Yes and also change Columns(first).Select to Columns(first + 1).Select.

note also that is only changes the immediate left column. I read in one of
your replies that you wanted to count columns to the left. Does that mean you
want to change all columns to the left except column A?
 
try
Sub findrunningtotalcol()
mc = Rows(1).Find("Running Total").Column - 1
MsgBox mc
Range(Cells(1, 2), Cells(1, mc)).EntireColumn.Value = _
Range(Cells(1, 2), Cells(1, mc)).EntireColumn.Value
End Sub
 
Sean, yes that's right

Greg said:
Yes and also change Columns(first).Select to Columns(first + 1).Select.

note also that is only changes the immediate left column. I read in one of
your replies that you wanted to count columns to the left. Does that mean you
want to change all columns to the left except column A?
 
Don, thank you very much

Greg
Don said:
try
Sub findrunningtotalcol()
mc = Rows(1).Find("Running Total").Column - 1
MsgBox mc
Range(Cells(1, 2), Cells(1, mc)).EntireColumn.Value = _
Range(Cells(1, 2), Cells(1, mc)).EntireColumn.Value
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top