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
'------------------------------------------------------------------------------ | |
'文字列として配列をクイックソート | |
'------------------------------------------------------------------------------ | |
'【引数】配列(参照渡し)、最小インデックス、最大インデックス | |
'【戻り値】 | |
'【備考】 | |
Public Sub QSortTexts(ByRef varArray As Variant, _ | |
lngMini As Long, lngMax As Long) | |
Dim i As Long | |
Dim j As Long |
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
'------------------------------------------------------------------------------- | |
'これから出力するファイルのフルパスを取得する | |
'------------------------------------------------------------------------------- | |
'【引数】出力先フォルダのパス(末尾に"\"あり),ファイル名(拡張子は含まない) | |
'【戻り値】出力するファイルのフルパス | |
'【備考】出力先に同名のファイルがある場合は"(x)"形式の文字列をファイル名の末尾に | |
' 付ける。 | |
Private Function GetOutputFileFullPath(strFolderPath As String, _ | |
strFileName As String, strExtension As String) As String | |
Dim FS As Object |
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
'------------------------------------------------------------------------------ | |
'配列をクイックソート | |
'------------------------------------------------------------------------------ | |
'【引数】配列(参照渡し)、最小インデックス、最大インデックス | |
'【戻り値】 | |
'【備考】 | |
Public Sub Q_Sort(ByRef varArray() As Variant, _ | |
lngMini As Long, lngMax As Long) | |
Dim i As Long | |
Dim j As Long |
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
'------------------------------------------------------------------------------- | |
'フォルダのパスを選択ダイアログで取得する | |
'------------------------------------------------------------------------------- | |
'【引数】 | |
'【戻り値】出力先のフォルダのパス | |
'【備考】選択ダイアログの初期値はデスクトップ。 | |
Private Function GetTargetFolderPath() As String | |
Dim WSH As Object | |
Dim strInitFolder As String | |
Dim strOutput As String |
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
"Microsoft DAO *** Object Library"が参照されていることが前提。 | |
'テーブル名をキー、該当テーブルのフィールド名をキーに持つDictionaryを値として持つDictionary | |
Private mDicFieldNames As Object | |
Public Sub Sample() | |
Const strTableName As String = "TestTable" | |
Const strFieldName As String = "TestField" | |
Call GetFieldNames(mDicFieldNames) |
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
Public Sub sample() | |
Const strExample As String = "今日は1月12日です。" | |
Debug.Print ConvertNumbersToKanSuji(strExample) | |
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
'------------------------------------------------------------------------------ | |
'フォルダに存在するファイルの名前一覧を取得する | |
'------------------------------------------------------------------------------ | |
'【引数】ファイル名を格納するDictionary、検索するパス | |
'【戻り値】 | |
'【備考】引数のDictionaryにファイル名を格納する。 | |
' サブフォルダは考慮しない。 | |
Private Sub GetExistingFileNames(dicFileName As Object, strPath As String) | |
Dim FSO As Object | |
Dim objFile As Object |
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
ActiveSheet.Protect DrawingObjects:=False, _ | |
Contents:=True, _ | |
Scenarios:=False, _ | |
AllowFormattingCells:=True, _ | |
AllowFormattingColumns:=True, _ | |
AllowFormattingRows:=True, _ | |
AllowInsertingColumns:=True, _ | |
AllowInsertingRows:=True, _ | |
AllowInsertingHyperlinks:=True, _ | |
AllowDeletingColumns:=True, _ |
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
#!ruby -Ks | |
require 'win32ole' | |
wsh = WIN32OLE.new('WScript.Shell') | |
# | |
# ユーザーが使用する前に設定する項目 | |
# | |
SHEET_LOCK = true #true:保護設定 false:保護解除 | |
PROTECT_PASSWORD = "" #パスワード(必要なときのみ) |
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
#!ruby -Ks | |
require 'win32ole' | |
wsh = WIN32OLE.new('WScript.Shell') | |
# | |
# 事前設定 | |
# | |
MACRO_FILE = "MacroFileName" | |
MACRO_NAME = "MacroName" |
NewerOlder