Hello,
I have a macro below that separates currency from a custom format. It works fine but as you can see it only addresses CAN and I need to be able to add additional currency like the ones I have listed below. How can I modify this vba to accomplish this?
Need to add:
"#,##0" ZAR";-#,##0" ZAR";#,##0;@"
"#,##0" INR";-#,##0" INR";#,##0;@"
"" £"#,##0;" £"-#,##0;#,##0;@" INR";#,##0;@" (Note this is a prefix symbol while the others listed about are suffixes)
Sub SeparateCurrency()Dim cell As RangeDim ConvertRange As RangeDim LastRow As LongDim FormatString As String LastRow = Range("A65536").End(xlUp).Row Set ConvertRange = ActiveSheet.Range("A1:A" & LastRow) For Each cell In ConvertRange FormatString = cell.NumberFormat cell.Select If cell.NumberFormat = "#,##0"" CAD"";-#,##0"" CAD"";#,##0;@" Then cell.Offset(0, 1).Value = "CAD" cell.Offset(0, 2).Value = cell.Value End If Next End Sub
</PRE>
I have a macro below that separates currency from a custom format. It works fine but as you can see it only addresses CAN and I need to be able to add additional currency like the ones I have listed below. How can I modify this vba to accomplish this?
Need to add:
"#,##0" ZAR";-#,##0" ZAR";#,##0;@"
"#,##0" INR";-#,##0" INR";#,##0;@"
"" £"#,##0;" £"-#,##0;#,##0;@" INR";#,##0;@" (Note this is a prefix symbol while the others listed about are suffixes)
Sub SeparateCurrency()Dim cell As RangeDim ConvertRange As RangeDim LastRow As LongDim FormatString As String LastRow = Range("A65536").End(xlUp).Row Set ConvertRange = ActiveSheet.Range("A1:A" & LastRow) For Each cell In ConvertRange FormatString = cell.NumberFormat cell.Select If cell.NumberFormat = "#,##0"" CAD"";-#,##0"" CAD"";#,##0;@" Then cell.Offset(0, 1).Value = "CAD" cell.Offset(0, 2).Value = cell.Value End If Next End Sub
</PRE>