Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Change Day to Month - VBA
Hi,
I got this macro from this NG to promt a password for a particular "day". How do you change the macro to a particular "month and year". from (#9/10/2007#) to Sep 2007 from (#9/11/2007#) to Oct 2007 from (#9/12/2007#) to Nov 2007 The format from vba help, "month(#9/10/2007#)" did not work. Sub PWforDate() Dim arrPwords(1 To 3, 1 To 2) As Variant Dim strPWord As String arrPwords(1, 1) = (#9/10/2007#) arrPwords(2, 1) = (#9/11/2007#) arrPwords(3, 1) = (#9/12/2007#) arrPwords(1, 2) = 1234 arrPwords(2, 2) = 2345 arrPwords(3, 2) = 3456 strPWord = CStr(Application.VLookup(Date, arrPwords, 2, 0)) MsgBox strPWord End Sub Thank you. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
6 month annualized % change | Excel Discussion (Misc queries) | |||
How do I put a Month into a cell and have the cells below change | Excel Discussion (Misc queries) | |||
How do you change the year but not the month automatically? | Excel Discussion (Misc queries) | |||
how do i change the format for excel to day-month | Excel Worksheet Functions | |||
month to month % change | Excel Worksheet Functions |