I am using the following to code with a warning message. However this warning message appears each time the macro is run? Can this be modified in such a manner so that it will show the warning message only once for first time it is run on each opening of WB?
Also posted hereSub mln() Dim a a = MsgBox("Please note that this will replace formulae with value.So you are requested to run this on a copy of the file.", vbYesNo + vbExclamation, "Important") If a = vbYes Then For Each c In Selection c.Value = Application.WorksheetFunction.Round(c / 1000000, 2) Next c End If End Sub
http://www.mrexcel.com/board2/viewtopic.php?t=284973
A solution to this was provided at mrexcel,but not able to run the code. I dont know whether the code is running well or not as I am not able to run the code. Can someone here please help me to run the code?
Actually now the problem to me is the "flag" concept. What is this & how can I use this to run the code?
The code provided there is
Option Explicit Private Sub Workbook_Open() Dim rFlag As Range Dim a Set rFlag = Sheet1.Cells(.Rows.Count, .Columns.Count) If rFlag.Value + "" Then a = MsgBox("Please note that this will replace formulae with value.So you are requested to run this on a copy of the file.", vbYesNo + vbExclamation, "Important") If a = vbYes Then 'this code will not convert to value! 'For Each c In Selection ' c.Value = Application.WorksheetFunction.Round(c / 1000000, 2) 'Next c 'this will Worksheets.Select Cells.Select Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues ActiveSheet.Select Application.CutCopyMode = False 'set flag rFlag.Value = 1 Else: End End If End If End Sub





Reply With Quote