<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ycloud</author_name>
  <author_url>https://blog.hatena.ne.jp/ycloud/</author_url>
  <blog_title>shikumika’s diary</blog_title>
  <blog_url>https://shikumika.org/</blog_url>
  <categories>
    <anon>VBA</anon>
    <anon>Excel</anon>
  </categories>
  <description>Excel VBAで「マクロの実行後、次のマクロ実行時まで変数を保持したい」と思ったことはありませんか？このような場合に便利なのがモジュールレベル変数です。今回は、モジュールレベル変数の有効期間と使い方について、カウンター機能で動作確認しながら説明します。 内容： VBAサンプルコード：カウンター機能 モジュールレベル変数の有効期間 予備知識：スコープについて 利用上の注意点 確認のExcelは「Microsoft® Excel® for Microsoft 365 MSO」 (バージョン 2510）です。 VBAサンプルコード：カウンター機能 Dim x As Long Sub カウンター(…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fshikumika.org%2Fentry%2Fexcel-vba-variable-lifetime&quot; title=&quot;【Excel VBA】モジュールレベル変数の有効期間と使い方｜カウンター機能で動作確認 - shikumika’s diary&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/y/ycloud/20251208/20251208203844.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-12-09 12:30:00</published>
  <title>【Excel VBA】モジュールレベル変数の有効期間と使い方｜カウンター機能で動作確認</title>
  <type>rich</type>
  <url>https://shikumika.org/entry/excel-vba-variable-lifetime</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
