David Schaleger
Board Regular
- Joined
- Dec 6, 2010
- Messages
- 55
I need VBA code to convert a column's (B, in this case) cell number format from the default "general" to 2-digit decimal. Thank you.
Since we are doing the whole column, it is simpler to just use Columns instead of Range...Range("B1").EntireColumn.NumberFormat = "#.00"
This question has me a little confused. It would indicate that you always want Column B to have the cell number format of "0.00", but if that is the case, then why not simply select the column, apply the Cell Format normally (not with VB, but using Excel's Cell Format functionality) and Save the workbook? Once you do that, Column B will always have the indicated cell number format. Or are you saying your code or, heaven forbid, your users will change the columns cell format during its use?Thank you. How do I make this happen "on open"?