VBA Formatting Questions

rhouston1908

New Member
Joined
Oct 24, 2011
Messages
26
1. I have a date field within a userform, how do I format that field to display the mm/dd/yy format within a cell?

2. How do I format percentages?

3. How do I format currency? (US Dollars)
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
<!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:DoNotOptimizeForBrowser/> </w:WordDocument> </xml><![endif]--> Right click the cell and choose “Format Cells”
Choose the type of data date, number, currency, percentage
Choose format

Alternatively in a macro use the format command i.e.

MsgBox Format(Now(), "dddd, mmmm dd yyyy")

<table style="width: 347px; border-collapse: collapse; height: 41px;" border="0" cellpadding="0" cellspacing="0"> <tbody><tr style="height:13.2pt"> <td style="width:194.0pt;padding:.55pt .55pt 0in .55pt; height:13.2pt" nowrap="nowrap" valign="bottom" width="323"> Displays: Monday, November 07 2011
</td> </tr> </tbody></table>
 
Upvote 0

Forum statistics

Threads
1,214,655
Messages
6,120,760
Members
448,991
Latest member
Hanakoro

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top