Avatar of Aaron Roessler
Aaron Roessler
 asked on

Excel VBA macro to find and clear/delete any cell with currency format

Simple Macro that will find any cell with format of currency and clear data.

Screen-Shot-2020-03-09-at-11.09.48-A.jpgFalcon.xlsx
VBA

Avatar of undefined
Last Comment
Aaron Roessler

8/22/2022 - Mon
Martin Liss

Sub ClearCurrency()
Dim cel As Range

With ThisWorkbook.ActiveSheet
    For Each cel In .UsedRange.Cells
        If VarType(cel) = vbCurrency Then
            cel.Clear
        End If
    Next
End With

End Sub

Open in new window

Aaron Roessler

ASKER
I need this to work when adding Macro to Personal.XLSB since I have 165 files I need to remove currency from.
Martin Liss

I've never used a Personal.XLSB, but can't you just copy the macro I posted to your Personal.XLSB workbook?
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Aaron Roessler

ASKER
This video will help explain whats happening.  https://www.loom.com/share/e3f187346d924e6abb77d435cb4c3b75

I have 160+ excel files I need to remove currency from... So the macro needs to run from a master file and not pasted into each of the 160+ files.  the Personal.xlsb is a Master doc thats always there when I open Excel
Martin Liss

Hopefully this article will help you.
ASKER CERTIFIED SOLUTION
Aaron Roessler

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.