mori– Author –
-
VBA樹林
[VBA] Change Only the Outline Color of a Clicked Shape
Overview In this article, I will introduce a minimal Excel VBA code that changes only the outline color of a shape (button) when you click it. This code targets the specific shape you clicked and does not affect other elements like chart... -
VBA樹林
[Excel VBA] How to Open All Hyperlinks in a Worksheet at Once
It is common to create lists of links in Excel, such as websites, files, or shortcuts to other sheets. However, clicking these links one by one can be time-consuming. This article introduces a method using VBA to automatically open all h... -
VBA樹林
[Excel VBA] How to Change PivotTable Calculation Methods and Number Formats
In Excel PivotTables, numeric fields are automatically summed by default. However, in many business scenarios, you need to calculate averages, counts, or distinct counts instead of sums. Additionally, applying proper number formatting (s... -
VBA樹林
[Excel VBA] Getting the Current Folder (CurDir) and Its Caveats
When handling files in VBA, you may want to base operations on the current working directory, also known as the "Current Folder." For example, if you save a file using only a filename without specifying a full path, it is saved in this c... -
VBA樹林
[VBA Beginners] Preventing Input Errors: How to Set Up Warning Message Boxes for Invalid Data
In Excel, you can use the Data Validation feature to restrict the range or type of values entered into a cell to prevent errors. This article explains how to use VBA to automate this process, specifically focusing on how to display a cus... -
VBA樹林
[Excel VBA] Automating Word Document Formatting: Styles and Alignment
When creating Word documents from Excel using VBA, simply pasting data isn't always enough. You often need to format the document—applying heading styles, centering text, or styling tables—to make it look professional. With VBA, you can ... -
VBA樹林
[VBA] How to Disable (Uninstall) an Excel Add-in Using a Macro
If you distribute specific tools as Excel Add-ins, it is very user-friendly to provide a feature that allows users to temporarily turn off the functionality or easily disable it when it is no longer needed. Asking users to manually open ... -
VBA樹林
[Excel VBA] How to Delete All Sheets Except One Specific Sheet
There are many situations where you want to clear all report sheets created during a previous process before running a macro again, while keeping a specific "Template" or "Master" sheet intact. When deleting multiple sheets in VBA, the m... -
VBA樹林
[VBA] How to Append Values to the Bottom of a Column: Transferring Calculation Results to Another File
In this article, I explain how to use VBA to calculate values in one Excel file and append the result to the bottom of a specific column in a separate file. Background The goal was to calculate the average value of data in Column E of an... -
VBA樹林
[Excel VBA] How to Aggregate Data from Multiple Closed Excel Files
Aggregating data from multiple Excel files is a common business task, but manually opening, copying, and pasting each file is extremely time-consuming. This article explains how to create a VBA macro that automatically opens closed Excel... -
VBA樹林
[Excel VBA] How to Manipulate Table Data by Record: Using ListRow
When working with Excel Tables (ListObject) in VBA, there are often times when you want to retrieve, edit, or delete data one row (record) at a time. In VBA, you can use ListRows(row_number) to easily manipulate specific records. This ar... -
VBA樹林
[VBA] How to Determine Which OptionButton is Selected in a UserForm
In VBA UserForms, there are many situations where you want the user to choose only one item from multiple options (e.g., selecting gender or survey ratings). The OptionButton control is perfect for this purpose. OptionButtons within the ... -
VBA樹林
[VBA] How to Lock and Unlock Cells: Using the Locked Property
I recently wanted to lock only specific cells using VBA, so I learned the method for locking and unlocking cells programmatically. Solution: Using the Locked Property In Excel VBA, you can control whether cells are locked (editing prohib... -
VBA樹林
[VBA] How to Display Long Scrollable Text in a UserForm TextBox (Read-Only)
In VBA UserForms, there are times when you need to display long text—such as Terms of Service, application help, or detailed notes—that the user should read but not edit. In such cases, using a multi-line TextBox as a "read-only display ... -
VBA樹林
[VBA] How to Set the Initial Folder for File Dialog Boxes (ChDrive and ChDir)
When using a dialog box to select files in VBA, it can be very tedious to manually navigate to deep folder hierarchies if the initial folder is not set correctly. This article explains how to specify the folder that appears first when a ... -
C#樹林
[C#] How to Get File Size and Convert Units
In many programming scenarios, such as checking file upload limits or monitoring the growth of log files, you often need to retrieve the physical size (number of bytes) of a file. In C#, using the Length property of the System.IO.FileInf... -
C#樹林
【C#】ファイルのサイズ(容量)を取得する方法と単位変換
ファイルのアップロード制限チェックや、ログファイルの肥大化監視など、プログラム内でファイルの物理的なサイズ(バイト数)を取得したい場面は頻繁にあります。 C#でファイルサイズを取得するには、System.IO.FileInfo クラスの Length プロパティを使... -
Python樹林
[Python] Accessing SQLite3 Data by Column Name Using sqlite3.Row
By default, Python's sqlite3 module returns data as tuples. However, by changing a specific setting, you can access values by specifying their "column names," just like a dictionary. This eliminates the need to worry about the order of c... -
Python樹林
【Python】SQLite3でカラム名を指定して値を取得する方法
Pythonの sqlite3 モジュールでは、デフォルトのデータ取得形式はタプル(tuple)ですが、設定を変更することで辞書のように「カラム名」を指定して値にアクセスすることが可能になります。これにより、SQLのSELECT文で取得したカラムの順序を気にする必要... -
Python樹林
[Python] Basics of Retrieving Data with SQLite3: Cursor Loop vs. fetchall vs. fetchone
When retrieving data from a database using Python's standard sqlite3 module, there are several methods available. This article explains how to directly iterate over the cursor object, how to retrieve everything at once using fetchall(), ... -
Python樹林
【Python】SQLite3でデータを取得する基本:cursorループ・fetchall・fetchoneの使い分け
Python標準ライブラリの sqlite3 モジュールを使用してデータベースからデータを取得する際、いくつかの方法が存在します。ここでは、cursor オブジェクトを直接反復処理する方法、fetchall() でリストとして一括取得する方法、そして fetchone() で1行ず... -
Python樹林
[Python] Executing SQL with SQLite3: Creating a Member Table and Inserting Data
This article demonstrates how to use the sqlite3 module to perform "Table Creation (CREATE)" and "Data Registration (INSERT)" operations. We will simulate a database that manages member information for a web service, implementing securit... -
Python樹林
【Python】SQLite3でSQL文を実行する:会員テーブルの作成と登録
sqlite3 モジュールを使用し、データベースへの「テーブル作成(CREATE)」と「データ登録(INSERT)」を行う実装です。 ここでは、Webサービスの会員情報を管理するデータベースを想定し、セキュリティを考慮したプレースホルダを使用した実装を行います... -
Python樹林
[Python] Connecting to and Disconnecting from SQLite3 Databases: File vs. In-Memory
Using the Python standard library sqlite3, you can create and manage lightweight relational databases that run on local files or in memory, without needing to set up a separate server. This article explains how to connect to a database f... -
Python樹林
【Python】SQLite3データベースへの接続と切断:ファイルDBとオンメモリDB
Python標準ライブラリの sqlite3 を使用すると、別途サーバーを立てることなく、ローカルファイルやメモリ上で動作する軽量なリレーショナルデータベースを作成・操作できます。 ここでは、データベースファイル(永続化)への接続方法と、データ保存しな... -
C#樹林
[C#] Changing File Extensions (Path.ChangeExtension)
When renaming files, especially when you only want to change the extension (e.g., .jpeg -> .jpg), performing manual string manipulation often leads to errors in determining the position of the dot. Using the Path.ChangeExtension metho... -
C#樹林
【C#】ファイルの拡張子を変更する (Path.ChangeExtension)
ファイルをリネームする際、特に「拡張子だけを変えたい(例:.jpeg → .jpg)」という場合、手動で文字列操作を行うとドットの位置の判定などでミスが起きがちです。 Path.ChangeExtension メソッドを使用すると、パス文字列内の拡張子部分だけを安全に書... -
C#樹林
[C#] Copying, Moving, and Deleting Files (Basic Operations of the File Class)
File system operations, such as creating file backups, moving processed files, or deleting unnecessary logs, are performed using the static methods of the System.IO.File class. When performing these operations, exceptions (errors) can ea... -
C#樹林
【C#】ファイルのコピー・移動・削除を行う (Fileクラスの基本操作)
ファイルのバックアップ作成や、処理済みファイルの移動、不要なログの削除など、ファイルシステムへの操作は System.IO.File クラスの静的メソッドを使用して行います。 これらの操作を行う際は、対象のファイルが存在しない場合や、移動先に同名のファイ... -
C#樹林
[C#] Converting Relative Paths to Absolute Paths (Full Paths) (Path.GetFullPath)
When "relative paths" (e.g., ..\Data\input.csv) are specified in command line arguments or configuration files, you often need to convert them to "absolute paths" (full paths) inside the program to correctly locate the file. Using the Pa...