convert formulas into values

shamsu203

Board Regular
Joined
Jun 12, 2014
Messages
70
Office Version
  1. 365
Platform
  1. Windows
HI
I have a vba which converts formulas into values . I want to know if it is possible for the macro to run on completion of a certain period say 12 month based on the date difference between todays date and the start date. the macro i use is given beow
Sub ConvertToValues()

Dim MyRange As Range

Dim MyCell As Range

Set MyRange = Selection

For Each MyCell In MyRange

If MyCell.HasFormula Then

MyCell.Formula = MyCell.Value

End If

Next MyCell

End Sub
tks for any suggestion you provide
shamsu
 
Hi
THe new code works perfectly?. Tks for ur patience and help. one last question to automate it so that the macro is run every time the workbook is opened should I add the the two line code to the worksheet named expense
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
As mentioned previously, this code should be placed in ThisWorkbook code window
VBA Code:
Private Sub Workbook_Open()
    Call ConfirmValues
End Sub

ThisWorkbook.jpg
 
Upvote 0

Forum statistics

Threads
1,215,006
Messages
6,122,666
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top