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

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
<!--[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,817
Messages
6,121,720
Members
449,050
Latest member
MiguekHeka

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