JonXL
Well-known Member
- Joined
- Feb 5, 2018
- Messages
- 513
- Office Version
- 365
- 2016
- Platform
- Windows
Hello!
I am trying to figure out how I can convert the
I've reviewed both the NumberFormat information as to possible codes and the Format information for the same. What I've come up with so far is that I would need to account for the
Any help is appreciated!
Thank you,
Jon
I am trying to figure out how I can convert the
.NumberFormat
string (eg, "_($* #,##0.00_)") to a string that can be used for the VBA Format()
function (for this example it would be "$#,##0.00") to get an output formatted as close as possible to the original (taken from the cell using .Value
) ignoring the color codes and spacing codes.I've reviewed both the NumberFormat information as to possible codes and the Format information for the same. What I've come up with so far is that I would need to account for the
_
and *
plus the symbols that follow them. Also there would be some of the special symbols like >
that would need to be rendered differently to ensure they don't do something they aren't supposed to... I'm wondering if there is anything else that needs to be accounted for OR even better, if someone is aware of a function that's already floating around the internet to do this that I can drop into my code without having to rewrite it. I searched and searched but because NumberFormat pages almost all also have the word Format and VBA in them, it'd be impossible for me to filter through the irrelevant results to find the ones I need so Googling hasn't gotten me too far.Any help is appreciated!
Thank you,
Jon