View Single Post
  #8   Report Post  
Old January 6th 18, 01:56 PM posted to microsoft.public.excel.worksheet.functions
GS[_6_] GS[_6_] is offline
external usenet poster
First recorded activity by ExcelBanter: Apr 2015
Posts: 1,001
Default Excel Macro: Type mismatch (Error 13)

Oops.., didn't fully cleanup after testing! The working code follows...

Sub RoundCurrencyValues()
Dim rng As Range, crng
On Error Resume Next 'in case no Range("pctChange")
Set rng = ActiveSheet.Range("pctChange")
If Not rng Is Nothing Then
For Each crng In ActiveSheet.UsedRange.Cells
If crng.NumberFormat = sCurrencyFormat Then crng.Value =
WorksheetFunction.Round(crng * (1 + rng), 2)
Next 'crng
End If 'Not rng Is Nothing
Set rng = Nothing
End Sub


Free usenet access at
Classic VB Users Regroup!