Question Determine which cells are currency in Excel

bendy_leather

New member
Joined
Oct 24, 2019
Messages
1
Programming Experience
Beginner
Hello all, I am very new to vb.net and am looking at writing some code that will seek out all currency cells in an excel workbook and replace the number formatting with a new currency symbol.

In VBA i use VARTYPE(cell address) and it would return a 6 if it is a currency cell. When i try doing the same in vb.net i get 'object' returned every time (as my xlRng variable is set as an Excel.Range). I understand why it's doing this but i cant work out how to determine whether the excel range is currency or not.

Is this even possible? Any advice would be sincerely appreciated. I apologise if this is a stupid question!

Many thanks.
 
Check cell.Style.Name
 
Back
Top