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
Rem -------------------------------------------------- | |
Rem ■kccFuncString | |
Rem 文字列変換関数 からの抜粋 | |
Rem | |
Rem | |
Rem -------------------------------------------------- | |
Option Explicit | |
Rem 文字列を一文字毎の配列に変換 | |
Rem |
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 | |
'#VBAクイズ | |
'出典:http://www.excel.studio-kazu.jp/kw/20200517225250.html | |
'> AAAの値をAAB,AAC...AAZまでインクリメントし | |
'> 次のアルファベットを桁上げし、ABA,ABC?ZZZまで | |
'> 計算するコードを書きたい | |
'の解答 | |
'https://twitter.com/KotorinChunChun/status/1262026213352026112?s=20 |
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
Rem -------------------------------------------------------------------------------- | |
Rem | |
Rem @module kccFuncExcelPartial | |
Rem | |
Rem @description Excelオブジェクト操作関数 | |
Rem | |
Rem @update 2020/06/24 | |
Rem | |
Rem @author @KotorinChunChun (GitHub / Twitter) | |
Rem |
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 | |
Rem 動的に多次元配列のテストデータを生成するテスト | |
Sub Test_CreateTestArray() | |
Dim tStart As Single, tStop As Single: tStart = Timer | |
Dim i | |
For i = 1 To 1000 | |
Dim arr | |
arr = CreateTestArray(1, 5, 4, 3, 4, 5) |
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 | |
Private name_ | |
Private age_ | |
Rem 標準モジュール用 | |
Public Function Init1(pName, pAge) As MyClass | |
Set Init1 = Me | |
name_ = pName | |
age_ = pAge |
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
VERSION 1.0 CLASS | |
BEGIN | |
MultiUse = -1 'True | |
END | |
Attribute VB_Name = "BinaryFileIO" | |
Attribute VB_GlobalNameSpace = False | |
Attribute VB_Creatable = False | |
Attribute VB_PredeclaredId = True | |
Attribute VB_Exposed = False | |
Rem -------------------------------------------------------------------------------- |
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
Rem 選択中のセルの化学式の書式を整えるVBAマクロ | |
Sub 選択範囲の化学式の書式を整える() | |
Dim MyRange As Range | |
Dim i As Integer | |
Dim s2 As String, s3 As String | |
Dim PHflg As Boolean | |
For Each MyRange In Selection | |
For i = 2 To Len(MyRange.Text) | |
s2 = Mid(MyRange.Text, i - 1, 2) |
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 | |
'#VBA100本ノック 13本目 | |
'選択セル(Selection:複数範囲あり)の文字列に「注意」という文字があった場合は、 | |
'その「注意」の文字だけを"赤の太字"に設定してください。 | |
'セル以外(図形等)が選択されている場合は何もせずに正常終了するようにしてください。 | |
'※一部仕様を無視 | |
' 図形選択前に選択していたセルを使ってでも絶対に処理を実行する | |
Sub vba_knock013() |
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 | |
'VBA100本ノック14本目 | |
'出題を勘違いして答えた人の末路 | |
Sub vba_knock14() | |
Dim wb As Workbook: Set wb = ActiveWorkbook | |
Dim ws As Worksheet | |
Dim moveWss As Variant: ReDim moveWss(0 To 0) '0はダミー | |
'削除すべきシートを特定 |
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
Rem | |
Rem VBEでVBSを編集するための偽WScriptクラス | |
Rem | |
Rem 開発 : @KotorinChunChun | |
Rem | |
Option Explicit | |
Rem WScript オブジェクトのプロパティとメソッド | |
Rem https://docs.microsoft.com/ja-jp/previous-versions/windows/scripting/cc364456(v=msdn.10) |