Is there a way I can format a cell using VBA code?
I am using code to create a list of numbers. These numbers are dollar amounts so I would like to format them as currency ($X,XXX.XX). I then want to use the SUM worksheet function to sum the numbers so I cannot simply append a dollar sign to the front of the number. I also cannot format the cells on the worksheet ahead of time because the program uses the 'Clear' function to delete previous data before making a new list, but the 'Clear' function also seems to be clearing any formatting.
So how can I format the values as currency as the VBA code writes them to their cells?
Bookmarks