Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Bastet Massri   on Jan 29 In MS Office Category.

  
Question Answered By: Ora Hanson   on Jan 29

Try thinking outside the box.

My first thought is to store a value in a most likely unused cell in the
worksheet. The vast majority of workbooks do not use every single cell.
So you could easily choose the last available row, or even the last row
and column.

The idea is simple. When someone runs the code  for the first time  and
they answer "yes", store something, a number, or even the word "yes" in
this cell. You can have your code check this cell every time someone
runs the code. If "yes" appears skip the question.

For example...

Sub mln()
Dim a
If Range("IV65536").Value = "yes" Then
Call RunFunction
Else
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
Range("IV65536").Value = "yes"
Call RunFunction
End If
End If
End Sub

Sub RunFunction()
For Each c In Selection
c.Value = Application.WorksheetFunction.Round(c / 1000000, 2)
Next c
End If

End Sub

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Messabe Box to appear once Or get search suggestion and latest updates.


Tagged: