Thursday, December 17, 2020

Convert all Formulas into Values VBA

 

Convert all Formulas into Values

Sub convertToValues()

Dim MyRange As Range

Dim MyCell As Range

Select Case _

MsgBox("You Can't Undo This Action. " _

& "Save Workbook First?", vbYesNoCancel, _

"Alert")

Case Is = vbYes

ThisWorkbook.Save

Case Is = vbCancel

Exit Sub

End Select

Set MyRange = Selection

For Each MyCell In MyRange

If MyCell.HasFormula Then

MyCell.Formula = MyCell.Value

End If

Next MyCell

End Sub

No comments:

Post a Comment

THANKS FOR YOUR SUPPORT

Data copy paste on two another sheet with add row in google sheet by script

 function copyDataWithinWorkbook() {   var sourceSheetName = "Dashbord"; // Replace with the name of the source sheet   var target...