Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Assistance with macro syntax?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
David McRitchie  
View profile  
 More options Feb 28 2000, 3:00 am
Newsgroups: microsoft.public.excel.worksheet.functions
From: "David McRitchie" <DMcRitc...@msn.com>
Date: 2000/02/28
Subject: Re: Assistance with macro syntax?

Hi Steven,    (  http://www.deja.com/=dnc/getdoc.xp?AN=590705514  )
I would modify Nick Hodge's <nick_ho...@lineone.net> code
to default to the formula in the active cell to simplify entry.  I would
also split up the inputbox so that the Cancel Button would function.

Sub purgeFormula()
'Nick Hodge  2000-02-28 excel.worksheet.functions
'convert specified formula to value,  modified version
Dim purgeFormula As String
Dim x As Long
Dim rRange As Range
Dim myCell As Range
Set rRange = ActiveSheet.UsedRange
x = 0
'-------
purgeFormula = Application.InputBox("Enter the " & _
 "formula to purge", "Formula", ActiveCell.Formula, , , , , 0)
If purgeFormula = "" Then Exit Sub
If Left(purgeFormula, 1) <> "=" Then Exit Sub
purgeFormula = Application.ConvertFormula(purgeFormula, xlR1C1, xlA1)
'-------
For Each myCell In rRange.SpecialCells(xlCellTypeFormulas)
If myCell.Formula = purgeFormula Then
myCell.Copy
myCell.PasteSpecial Paste:=xlPasteValues
x = x + 1
End If
Next myCell
MsgBox x & " occurrence(s) of the formula: " & purgeFormula & _
   " have been converted to values"
ActiveSheet.Copy After:=Worksheets(Worksheets.Count)
End Sub


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.