This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Sub メール作成() | |
'メール作成時のおまじない | |
'Outlookアプリケーションオブジェクトの取得 | |
Dim MyOutlook As Outlook.Application | |
Set MyOutlook = New Outlook.Application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Sub メール作成2() | |
'メール作成時のおまじない | |
'Outlookアプリケーションオブジェクトの取得 | |
Dim MyOutlook As Outlook.Application | |
Set MyOutlook = New Outlook.Application | |
'メールitemオブジェクトの取得 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub find() | |
Dim Target As Range | |
Set Target = Range("B:B").find(what:="りんご") | |
Debug.Print (Target.Address) | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub find() | |
Dim Target As Range | |
Set Target = Range("B:B").find(what:="りんご") | |
Target.Offset(0, 1).Value = "おいしい" | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub find3() | |
Dim Target1 As Range, Target2 As Range | |
Set Target1 = Range("B:B").find(what:="りんご", searchdirection:=xlNext) | |
Set Target2 = Range("B:B").find(what:="りんご", searchdirection:=xlPrevious) | |
Target1.Offset(0, 1).Value = "おいしい" | |
Target2.Offset(0, 1).Value = "うまい" | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub メール作成2() | |
'メール作成時のおまじない | |
'Outlookアプリケーションオブジェクトの取得 | |
Dim MyOutlook As Outlook.Application | |
Set MyOutlook = New Outlook.Application | |
'メールitemオブジェクトの取得 | |
Dim Mailitem As Outlook.Mailitem | |
Set Mailitem = MyOutlook.CreateItem(olMailItem) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub 文字列を置換する() | |
Dim S As String | |
S = replace("ぽんぽん", "ん", "い") | |
Debug.Print (S) | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub 時間帯() | |
If CDate("10:00") >= Time And Time < CDate("13:00") Then | |
処理A | |
ElseIf CDate("13:00") >= Time And Time < CDate("17:00") Then | |
処理B | |
Else | |
処理C | |
End If | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dim FileName as string | |
dim PassCord as string | |
FileName = "任意の文字列" | |
PassCord = "任意の文字列" | |
Workbooks.add | |
with activeworkbook | |
.saveas FileName ,password:=PassCord |