I am not sure this is a question for here, so shoot me if it's not!
I have a spreadsheet that contains data of both number and currency format. I am to delete the values in the cells that are of currency format only.
I can do this with a simple For Each loop, however, due to the size of the spreadsheet this is not efficient.
Option Explicit
Sub ClearCurrency()
Dim myRange As Range
Dim cell As Range
Set myRange = Selection
For Each cell In myRange
If cell.NumberFormat = "$#,##0.00" Then
cell.ClearContents
End If
Next cell
End Sub
I have read up on VarTypes and .NumberFormat but am unable to piece together a more efficient solution.
I know I cannot store the information to an array to loop through, so is there a faster way?