mnuttall87
New Member
Quick question relating to VBA. I have a sheet of financial statement data where cells contain text, such as 1.46M, or 14.0K, etc. I would prefer that each individual cell contained the actual value, so the 1.46M cell should show 1,460,000 and the 14K cell should show 14,000.
I came up with an =IF formula that reads something like:
=IF(RIGHT(C5)="M",LEFT(C5,(LEN(C5)-1))*1000000,IF(RIGHT(C5)="K",LEFT(C5,(LEN(C5)-1))*1000,IF(RIGHT(C5)="B",LEFT(C5,(LEN(C5)-1))*1000000000,IF(C5="","",0))))
It basically checks the letter in the cell and multiplies the cell by the correct number.
Is there a way that I can select all of the financial data, and then have VBA say:
For Each Cell in Selection
'Apply above =If Formula to Cells.Value and Paste as Value
Next Cell
Or something along those lines?
Thanks in advance for any help.
I came up with an =IF formula that reads something like:
=IF(RIGHT(C5)="M",LEFT(C5,(LEN(C5)-1))*1000000,IF(RIGHT(C5)="K",LEFT(C5,(LEN(C5)-1))*1000,IF(RIGHT(C5)="B",LEFT(C5,(LEN(C5)-1))*1000000000,IF(C5="","",0))))
It basically checks the letter in the cell and multiplies the cell by the correct number.
Is there a way that I can select all of the financial data, and then have VBA say:
For Each Cell in Selection
'Apply above =If Formula to Cells.Value and Paste as Value
Next Cell
Or something along those lines?
Thanks in advance for any help.