|
Format Cells in The Long Date Number Format in Excel
This free Excel macro formats a selection of cells in the Long Date number format in Excel. The Long Date number format displays the day of week, the month, the day of month, and the year. This Excel macro is a great way to quickly add this number format to a large number of cells in Excel.
This macro will add the Long Date number format to cells in Excel.
Where to install the macro: Module
Macro to Format Cells in The Long Date Format in Excel
Sub Format_Cell_Date_Long()
Selection.NumberFormat = "[$-F800]dddd, mmmm dd, yyyy"
End Sub
How to Install the Macro
- Select and copy the text from within the grey box above.
- Open the Microsoft Excel file in which you would like the Macro to function.
- Press "Alt + F11" - This will open the Visual Basic Editor - Works for all Excel Versions.
Or For other ways to get there, Click Here.
For Excel Versions Prior to Excel 2007 Go to Tools > Macros > Visual Basic Editor
For Excel 2007 Go to Office Button > Excel Options > Popular > Click Show Developer tab in the Ribbon. Then go to the Developer tab on the ribbon menu and on the far left Click Visual Basic
- On the new window that opens up, go to the left side where the vertical pane is located. Locate your Excel file; it will be called VBAProject (YOUR FILE'S NAME HERE) and click this.
- If the Macro goes in a Module, Click Here, otherwise continue to Step 8.
- Go to the menu at the top of the window and click Insert > Module
- Another window should have opened within the Visual Basic Editor's window. Within this new window, paste the macro code. Make sure to paste the code underneath the last line of anything else that is in the window.
- Go to Step 8.
- If the Macro goes in the Workbook or ThisWorkbook, Click Here, otherwise continue to Step 8.
- Directly underneath your excel file called VBAProject(your file's name here), click the Microsoft Excel Objects folder icon to open that drop-down list.
- Then, at the bottom of the list that appears, double-click the ThisWorkbook text.
- A new window inside the Visual Basic Editor's window will appear. In this new window, paste the code for the macro. Make sure to paste this code underneath the last line of any other code which is already in the window.
- Go to Step 8.
- If the Macro goes in the Worksheet Code, Click Here, otherwise continue to Step 8.
- Directly underneath your excel file called VBAProject(your file's name here), click the Microsoft Excel Objects folder icon to open that drop-down list.
- Within the list that appears you will see every worksheet that is in that excel file. They will be listed as such: Sheet1(NAME OF SHEET HERE) and under that will be Sheet2(NAME OF SHEET HERE). Select the sheet in which you want the macro to run and double-click that sheet.
- A new window inside the Visual Basic Editor's window will appear. In this new window, paste the code for the macro. Make sure to paste this code underneath the last line of any other code which is already in the window.
- Repeat steps b and c for every sheet you want the macro to work in. Putting the macro in one sheet will not enable it for any other sheets in the workbook.
- Go to Step 8.
- Close the Microsoft Visual Basic Editor window and save the Excel file. When you close the Visual Basic Editor window, the regular Excel window will not close.
- You are now ready to run the macro.
Similar Helpful Excel Resources
I have been working in a worksheet with 10 tabs, and suddenly all of my numbers turned to long date format. I manually changed them all back to what they were. General, Currency, %, etc. but the default seems to be stuck in the long date format. When I create a new tab it is automatically all long dates. Very strange.
Oh, and the other weird thing is when I send it to other people, some people see the correct formats and when other's open it the numbers all go back to the long date format. VERY Frustrating.
Would love to get some advice.
I want to correctly display the latitudes and longitudes of a list of
locations in the typical degree, minute, second format rather than a decimal.
Does anyone know whether or not this is possible?
Hi,
Im currently using With / End With statements to apply formulas or link in data via a named range.
What I want to be able to do is change the property of what I'm linking in to be in date format.
For example I have the code
Set FiscalYrPrd = Range("AG7:AH" & .Range("AA" & .Rows.Count).End(xlUp).Row)
With FiscalYrPrd
.Formula = "=C7"
.Value = .Value
End With
my understanding if that your changing the property of the variable to be a formula and then a value, therefore is it possible to change the format property of the range so its in date format (dd/mm/yy)?
Any help would be greatly appreciated!
In addition - same request but in numerical format with zero d.p?
Many thanks in advance.
Rgd,
SPiercy
This should be a super-simple formatting question but I can't get it to work.
The columns are very small and I'd like to put in the date or a number and have it span into Column B from Column A.
This works easily with text. But it won't work for me with any number or a date.
I've looked though all the formatting options and can't figure it out.
My first sheet contains the follwing cols.
DATE
SL.#
NAME
AMOUNT
NO. OF PYMNTS MADE
01/05/2005
1
ADAN
300
12/06/2006
2
BAND
200
14/07/2007
3
CHARGE
500
and my second sheet contains the date and voucher # of the monthly payments made.
SL.#
NAME
AMOUNT
May-05
Jun-05
Jul-05
Aug-05
Sep-05
Oct-05
Nov-05
DATE
VOUCHER#
DATE
VOUCHER#
DATE
VOUCHER#
DATE
VOUCHER#
DATE
VOUCHER#
DATE
VOUCHER#
DATE
VOUCHER#
1
ADAN
300
01/05/2008
12
02/06/2005
9
05/07/2005
4
05/08/2005
12
05/09/2005
2
06/10/2005
5
06/11/2005
1
2
BANH
200
3
CHARGE
500
4
DARLING
400
From the 2nd sheet I need to count the number of payments made by each person for which I only have the date and Vr# in the above format.
Could you help me in this please?
Thanks.
Sheet 1 contains the following columns :
Date Sl# Name Amount No. of pymnts
15-8-09 1 Adam 300.00
Sheet 2 contains the following cols.
Sl# Name Amount Month 1 Month 2 .....Month 100
Date Vr.# Date Vr. # Date Vr.#......
1 Adam 300.00 15-8-09 5 10-10-09 ....
I want to count the number of payments made by 1 Adams.
How do I go about this?
Greetings,
The long date format is:
Code:
[$-F800]dddd, mmmm d, yyyy
But what does the " [$-F800] " do?
Thanks,
Shane.
Hi all,
I have two columns. Column A contains years, '2010' for example. Column B contains months, 'Jan' or 'Mar' for example. Neither column is in date format. I want to merge them to 'Jan 2010'. Now that's easy enough, but I also want to make the cell a date and i find that much more tricky. In fact I'm lost. Is there anyone who could help me please?
Take care,
Karel
Hai,
I am Suresh Babu and I need to help in converting the Date format into Week number format
For example:
Existing date format is 9-Sep-2010 and I wanted to convert as 1036.4 (10-year, 36-Week & 4-day)
Please help
Regards,
Suresh Babu MS
Greetings,
The long date format is:
Code:
[$-F800]dddd, mmmm dd, yyyy
So what does the [$-F800] stand for?
Someone suggested that it was a locale ID, but F800 isn't in the list of Microsoft locales.
Thanks,
Shane.
|
|