Skip to content

Instantly share code, notes, and snippets.

@YuukiToriyama
Created May 17, 2019 06:20
Show Gist options
  • Save YuukiToriyama/160d36924820b13559414a1f93df60ff to your computer and use it in GitHub Desktop.
Save YuukiToriyama/160d36924820b13559414a1f93df60ff to your computer and use it in GitHub Desktop.
構想A

完全にエクセル函数を頭に入れた人用の「セルの入力からグラフの作成まですべてをコマンド入力だけで済ませるプラグイン」みたいなのをつくろうかと思っている。

@YuukiToriyama
Copy link
Author

セルA1に入力されているのが式なのかそうでないのか調べる方法

HasFormulaメソッド

Range("A1").HasFormulaはA1が式の場合Trueを、そうでない場合Falseを返します。

TypeName函数

TypeName(obj)は変数やオブジェクトの型を返します。

サンプルコード覚書

If Range("A1").HasFormula = True Then
    debug.print "A1 is a formula.\n"
else
    If TypeName(Range("A1").value) = String Then
        debug.print "A1 is String."
    Else
        debug.print "それ以外\n"
    End If
End If

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment