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)
 

Some videos you may like

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

tlowry

Well-known Member
Joined
Nov 3, 2011
Messages
1,367
<!--[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>
 

Watch MrExcel Video

Forum statistics

Threads
1,123,385
Messages
5,601,329
Members
414,445
Latest member
walramgo02

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
Top