Date-Time Functions – WeekDay() and WeekDayName()
文章推薦指數: 80 %
VBA-Excel: Date-Time Functions – WeekDay() and WeekDayName() ... Description: The WeekDay function takes Date as a parameter and returns a number ... Skiptocontent Menu WeekDay() Description: TheWeekDayfunctiontakesDateasaparameterandreturnsanumberbetween1and7,thatistheweekdayofthedateprovided. Format: WeekDay(strDate[Firstdayofweek]) Arguments: strDate Mandatory Type:Date Date,whoseWeekDateneedtobecalculated. Firstdayofweek Optional Type:Numeric Specifiesthefirstdayoftheweek Constant Value Description vbUseSystem 0 UsetheNLSAPIsetting. vbSunday 1 Sunday(default) vbMonday 2 Monday vbTuesday 3 Tuesday vbWednesday 4 Wednesday vbThursday 5 Thursday vbFriday 6 Friday vbSaturday 7 Saturday Example: FunctionFnWeekDay() DimstrDate strDate="15-July-2013" MsgBox"WeekDayofthe"&strDate&"is->"&Weekday(strDate) EndFunction WeekDay() _________________________________________________________________________________ WeekDayName() Description: TheWeekDayNamefunctionThetakesnumeric valueasaparameterandreturnsaweekdayName. Format: WeekdayName(intWeekday,blnAbbreviate,firstdayofweek) Arguments: intWeekDay Mandatory Type:Numeric Valuefrom1to7,MondaytoSunday,whoseWeekDayNameneedtobecalculated.LikeWeekDayName(1)willreturn“Monday” blnAbbreviate Optional Type:Boolean Truevaluewillprovidethemonthnameabbreviated,forexample“Monday”willbeabbreviatedto“Mon”,anddefaultvalueisFalse. Firstdayofweek Optional Type:Numeric Specifiesthefirstdayoftheweek Constant Value Description vbUseSystem 0 UsetheNLSAPIsetting. vbSunday 1 Sunday(default) vbMonday 2 Monday vbTuesday 3 Tuesday vbWednesday 4 Wednesday vbThursday 5 Thursday vbFriday 6 Friday vbSaturday 7 Saturday Example: FunctionFnWeekDayName() DimstrDate DimstrResult strDate="1-July-2013" strResult="FullWeekDayNameofthe"&strDate&"is->"&WeekdayName(Weekday(strDate))&vbCrLf strResult=strResult&"AbbriviatedWeekDayNameofthe"&strDate&"is->"&WeekdayName(Weekday(strDate),True) MsgBoxstrResult EndFunction WeekDayName() MostVisited VBA-Excel:CreateandSavetheWorddocument VBA-Excel:ReadDatafromXMLFile VBA-Excel:ReadXMLbyLoopingthroughNodes VBA-Excel:GetthenamesofallWorkSheetsinaExcel(WorkBook) Excel-VBA:Range-Lock/UnlockSpecificCells VBA-Excel:ConvertNumbers(Rupees)intoWordsORText-UpdatedTill1000000CroreWithDecimalNumbers Excel-VBA:SendMailwithEmbeddedImageinmessagebodyFromMSOutlookusingExcel. VBA-Excel:OpenanExistingWordDocument VBA-Excel:WritingTexttoWorddocument VBA-Excel:ReferenceLibrariesinExcelWorkBook. SubscribetoBlogviaEmail Enteryouremailaddresstosubscribetothisblogandreceivenotificationsofnewpostsbyemail. EmailAddress Subscribe RecentPosts VBA-Excel:ReadXMLbyLoopingthroughNodes VBA-Excel:CreateworksheetswithNamesinSpecificFormat/Pattern. VBA-Excel:AddWorksheetsForAllTheGivenDatesExceptWeekendsandCopyTheCommonTemplateInEachWorksheet VBA-Excel:CreateorAddWorksheetsattheRuntime. VBA-Excel:ChangeFont,Color,WeightofTableDataintheWorddocument VBA-Excel:ModifiedConsolidator–MergeorCombineMultipleExcelFilesIntoOneWhereColumnsAreNotInOrder SendMailWithLinktoaWorkbook,FromMSOutlookusingExcel. SendMailWithMultipleDifferentAttachmentsFromMSOutlookusingExcel. Excel-VBA:OpenaMSWordDocumentusingExcelFileusingExplorerWindow. Excel-VBA:SendUniqueImagesEmbeddedtoMailBody,WithEveryMailFromMSOutlookusingExcel. Excel-VBA:SendMailwithEmbeddedImageinmessagebodyFromMSOutlookusingExcel. Excel-VBA:SendaExcelWorkbookasAttachmentinMailFromMSOutlookUsingExcel Excel-VBA:OpenaExcelFileusingAnotherExcelFileusingBrowseOption. Excel-VBA:SendaMailusingPredefinedTemplateFromMSOutlookUsingExcel Excel-VBA:SendaSimpleMailFromMSOutlookUsingExcel
延伸文章資訊
- 1VBA WeekdayName Function - Automate Excel
WeekdayName Syntax · Weekday: A number representing the day of the week. · Abbreviate: [Optional]...
- 2VBA Function WEEKDAYNAME - BetterSolutions.com
WEEKDAYNAME(weekday [,abbreviate] [,firstdayofweek]) ... * If "abbreviate" = True then the weekda...
- 3How to Execute VBA Function Procedures in Excel 2016 - dummies
- 4VBA WEEKDAY Function - ExcelFunctions.net
- 5VBA Today Function - WallStreetMojo