Link to home
Start Free TrialLog in
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.

User generated imageFalcon.xlsx
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

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

Avatar of Aaron Roessler
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.
I've never used a Personal.XLSB, but can't you just copy the macro I posted to your Personal.XLSB workbook?
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
Hopefully this article will help you.
ASKER CERTIFIED SOLUTION
Avatar of Aaron Roessler
Aaron Roessler

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial