Hello
I am Getting Type Mistmatch error when using .Numberformat marked in Red
Did I miss something here therefore am i getting Type Mismatch error or is it the wrong method that i've adopted
NimishK
I am Getting Type Mistmatch error when using .Numberformat marked in Red
Did I miss something here therefore am i getting Type Mismatch error or is it the wrong method that i've adopted
Code:
Public Sub nmbrFormat()
Dim rNos As Range, cellsRNos As Range
Dim wsMis As Worksheet
Set wsMis = Worksheets("Sheet4")
With wsMis
Set rNos = Union(.Columns("BF"), .Columns("BG"), .Columns("BH"), .Columns("BI"), _
.Columns("BK"), .Columns("BL"), .Columns("BM"), .Columns("BN"), .Columns("BP"), .Columns("BQ"), _
.Columns("CG"), .Columns("CH"), .Columns("CI"), .Columns("CJ"))
End With
For Each cellsRNos In rNos
[COLOR=#ff0000] cellsRNos.NumberFormat = Trim(Replace(Format(String(Len(Int(cellsRNos.value)) - 1, "#"), " @@\\,@@\\,@@\\,@@\\,@@\\,@@\\,@@0"), " \,", "")) & ".00"[/COLOR]
Next
Last edited: