![](https://excel-vba.work/wp-content/themes/cocoon-master/images/b-woman.png)
VBAで
・曜日の英語表記を取得
できます!
![](https://excel-vba.work/wp-content/themes/cocoon-master/images/b-woman.png)
英語表記は
・省略された表記(wed等)
・省略されていない表記(wednesday等)
を取得できます!
※wednesdayは水曜日です。
![](https://excel-vba.work/wp-content/themes/cocoon-master/images/b-woman.png)
VBA関数である
・Format関数
により取得できます!
VBAコード
ここでは例として
・本日日付(=2022/4/20の水曜日)の
・曜日の英語表記(省略された表記)
・曜日の英語表記(省略されていない表記)
を取得します。
Sub sample()
'曜日の英語表記(省略された表記)を取得
MsgBox Format(Date, "ddd")
'曜日の英語表記(省略されていない表記)を取得
MsgBox Format(Date, "dddd")
End Sub
実行結果
本日日付から
・曜日の英語表記(省略された表記)
・曜日の英語表記(省略されていない表記)
を取得できました。
![曜日の英語表記(省略された表記)](https://excel-vba.work/wp-content/uploads/2022/04/vba_get_dayofweek_english_001.png)
![曜日の英語表記(省略されていない表記)](https://excel-vba.work/wp-content/uploads/2022/04/vba_get_dayofweek_english_002.png)
参考①
曜日の英語表記は「WorksheetFunction」オブジェクトの「Text」メソッドでも取得できます。
※「WorksheetFunction」オブジェクトの「Text」メソッドは、ワークシート関数の「Text関数」です。
ただ「Format関数」の方がシンプルと思うため、「Format関数」の使用をオススメします。
Sub sample()
'曜日の英語表記(省略された表記)を取得
MsgBox WorksheetFunction.Text(Date, "ddd")
'曜日の英語表記(省略されていない表記)を取得
MsgBox WorksheetFunction.Text(Date, "dddd")
End Sub
参考②
月の英語表記も取得できます。
詳細は以下の記事をご確認ください。
参考③
曜日の日本語表記も取得できます。
詳細は以下の記事をご確認ください。
参考④
上記で使用した以下の詳細は、公式サイトをご確認ください。
●Date関数
●Format関数