メインコンテンツへスキップ

Excelで特定の形状にマウスオーバーチップを追加するにはどうすればよいですか?

多くの場合、ワークシートでマクロをクリックして実行するには、マクロを特定の形状に割り当てる必要があります。 図形にマクロを割り当てた後、マウスオーバーチップを追加すると、将来の使用で図形が何をするかを思い出させるのに役立ちます。 この記事では、Excelで特定の形状にマウスオーバーチップを追加するXNUMXつの方法を示します。

ハイパーリンクを追加して、マウスオーバーチップを特定の形状に追加します
VBAコードを使用して特定の形状にマウスオーバーチップを追加します


ハイパーリンクを追加して、マウスオーバーチップを特定の形状に追加します

ScreenTipを使用して、ワークシートの特定の形状にハイパーリンクを追加できます。 次のようにしてください。

1.チップの上にマウスを追加するために必要な形状を右クリックし、クリックします ハイパーリンク 右クリックメニューから。 スクリーンショットを参照してください:

2。 の中に ハイパーリンクを挿入 ダイアログボックスで スクリーンヒント ボタン。 そして、 ハイパーリンクScreenTipを設定する ダイアログボックスで、マウスで図形にカーソルを合わせて表示する必要のある画面のヒントテキストを入力します。 最後にクリックします OK ボタン。 スクリーンショットを参照してください:

3.に戻ったとき ハイパーリンクを挿入 ダイアログボックスで ブックマーク ボタン。 次に、のセル参照ボックスのタイプにA1を入力します。 [ドキュメントに配置]を選択します ダイアログボックスをクリックし、最後に OK

4。 クリック OK ボタンの ハイパーリンクを挿入 ハイパーリンクの作成を終了するダイアログボックス。

これで、マウスで図形にカーソルを合わせると、画面のヒントが表示されます。


VBAコードを使用して特定の形状にマウスオーバーチップを追加します

次のVBAコードを実行すると、マウスオーバーチップを特定の形状に簡単に追加できます。

1.ワークシートを開くと、マウスを上に移動したときにヒントが表示される形状が含まれています。 シートタブを右クリックし、コンテキストメニューから[コードの表示]をクリックします。

2。 の中に アプリケーション向け Microsoft Visual Basic ウィンドウの場合は、以下のVBAコードをコードウィンドウにコピーしてください。

VBAコード1:マウスオーバーチップを特定の形状に追加

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Updated by Extendoffice 2018/3/30
    If Target.Address = Range("A1").Address Then
        Call MoveRow
    End If
End Sub

3。 クリック インセット > モジュール。 次に、モジュールウィンドウに以下のVBAコードを入力します。

VBAコード2:マウスオーバーチップを特定の形状に追加

Sub Text()
'Updated by Extendoffice 2018/3/30
    Dim xShape As Shape
    Dim xRg As Range
    On Error Resume Next
    Application.EnableEvents = False
    Set xShape = ActiveSheet.Shapes("Rectangle 4")
    If Not xShape Is Nothing Then
        ActiveSheet.Hyperlinks.Add xShape, "", "A1", ScreenTip:="Click to run Macro "
    End If
    If ActiveSheet.Hyperlinks(1).SubAddress = "A1" Then
        Call MoveRow
    End If
    Application.EnableEvents = True
End Sub

ノート:

1)。 「クリックしてマクロを実行"と"長方形4」と画面のヒントテキストと特定の形状の名前。
2)。 置換 "行を移動" 列をなして "MoveRowを呼び出す"シェイプに割り当てたマクロ名に

3。 プレス F5 コードを実行するためのキー。 すると、指定したスクリーンチップがすぐに特定の形状に追加されます。


関連記事:

最高のオフィス生産性向上ツール

🤖 Kutools AI アシスタント: 以下に基づいてデータ分析に革命をもたらします。 インテリジェントな実行   |  コードを生成  |  カスタム数式の作成  |  データを分析してグラフを生成する  |  Kutools関数を呼び出す...
人気の機能: 重複を検索、強調表示、または識別する   |  空白行を削除する   |  データを失わずに列またはセルを結合する   |   数式なしのラウンド ...
スーパールックアップ: 複数の基準の VLookup    複数の値の VLookup  |   複数のシートにわたる VLookup   |   ファジールックアップ ....
詳細ドロップダウン リスト: ドロップダウンリストを素早く作成する   |  依存関係のドロップダウン リスト   |  複数選択のドロップダウンリスト ....
列マネージャー: 特定の数の列を追加する  |  列の移動  |  Toggle 非表示列の表示ステータス  |  範囲と列の比較 ...
注目の機能: グリッドフォーカス   |  デザインビュー   |   ビッグフォーミュラバー    ワークブックとシートマネージャー   |  リソースライブラリ (自動テキスト)   |  日付ピッカー   |  ワークシートを組み合わせる   |  セルの暗号化/復号化    リストごとにメールを送信する   |  スーパーフィルター   |   特殊フィルター (太字/斜体/取り消し線をフィルター...) ...
上位 15 のツールセット12 テキスト ツール (テキストを追加, 文字を削除する、...)   |   50+ チャート 種類 (ガントチャート、...)   |   40+ 実用的 (誕生日に基づいて年齢を計算する、...)   |   19 挿入 ツール (QRコードを挿入, パスから画像を挿入、...)   |   12 変換 ツール (数字から言葉へ, 通貨の換算、...)   |   7 マージ&スプリット ツール (高度な結合行, 分割セル、...)   |   ... もっと

Kutools for Excel で Excel スキルを強化し、これまでにない効率を体験してください。 Kutools for Excelは、生産性を向上させ、時間を節約するための300以上の高度な機能を提供します。  最も必要な機能を入手するにはここをクリックしてください...

説明


Officeタブは、タブ付きのインターフェイスをOfficeにもたらし、作​​業をはるかに簡単にします

  • Word、Excel、PowerPointでタブ付きの編集と読み取りを有効にする、パブリッシャー、アクセス、Visioおよびプロジェクト。
  • 新しいウィンドウではなく、同じウィンドウの新しいタブで複数のドキュメントを開いて作成します。
  • 生産性を 50% 向上させ、毎日何百回もマウス クリックを減らすことができます!
Comments (8)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Convert your shape to an image. Images have tool tips.
This comment was minimized by the moderator on the site
Doesn't work..... if there is a hyperlink associated with the shape then the macro will not run....
This comment was minimized by the moderator on the site
Dear Niall,
Sorry for the mistake. Please try as below to solve the problem.

Step 1:
In the worksheet contains the shape you will display tip, right click the sheet tab and select View Code from the context menu. And then copy below VBA into the Code window:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = Range("A1").Address Then
Call MoveRow
End If
End Sub

Step 2:
Open the Module code window, copy below code into the Module window.
Please change "MoveRow" in the line Call MoveRow to the macro name you assigned to the shape, and then press the F5 key to run the code.
Thank you for your comment.

Sub Text()
Dim xShape As Shape
Dim xRg As Range
On Error Resume Next
Application.EnableEvents = False
Set xShape = ActiveSheet.Shapes("Rectangle 1")
If Not xShape Is Nothing Then
ActiveSheet.Hyperlinks.Add xShape, "", "A1", ScreenTip:="Click to run Macro "
End If
If ActiveSheet.Hyperlinks(1).SubAddress = "A1" Then
Call MoveRow
End If
Application.EnableEvents = True
End Sub
This comment was minimized by the moderator on the site
Dear Niall,
The code works well in my case. Can you provide your Office version? Thank you for your comment.
This comment was minimized by the moderator on the site
Hello, Sub Test() On Error Resume Next Dim xShape As Shape Set xShape = ActiveSheet.Shapes("Rectangle 4") If Not xShape Is Nothing Then _ ActiveSheet.Hyperlinks.Add xShape, "", "", ScreenTip:="Click to run Macro " End Sub Thank code works great, but it removes Assigned macro. When i use Screen Tip and press on shape Macro Deosn't work. Is any way to fix that? Use Screen tip on shape and keep macro working? Thank youĄ
This comment was minimized by the moderator on the site
Dear Evaldas,
Sorry for the mistake. Please try as below to solve the problem.

Step 1:
In the worksheet contains the shape you will display tip, right click the sheet tab and select View Code from the context menu. And then copy below VBA into the Code window:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = Range("A1").Address Then
Call MoveRow
End If
End Sub

Step 2:
Open the Module code window, copy below code into the Module window.
Please change "MoveRow" in the line Call MoveRow to the macro name you assigned to the shape, and then press the F5 key to run the code.
Thank you for your comment.

Sub Text()
Dim xShape As Shape
Dim xRg As Range
On Error Resume Next
Application.EnableEvents = False
Set xShape = ActiveSheet.Shapes("Rectangle 1")
If Not xShape Is Nothing Then
ActiveSheet.Hyperlinks.Add xShape, "", "A1", ScreenTip:="Click to run Macro "
End If
If ActiveSheet.Hyperlinks(1).SubAddress = "A1" Then
Call MoveRow
End If
Application.EnableEvents = True
End Sub
This comment was minimized by the moderator on the site
I wish someone would solve this problem.
This comment was minimized by the moderator on the site
Good Day,
Please try as below to solve the problem.

Step 1:
In the worksheet contains the shape you will display tip, right click the sheet tab and select View Code from the context menu. And then copy below VBA into the Code window:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = Range("A1").Address Then
Call MoveRow
End If
End Sub

Step 2:
Open the Module code window, copy below code into the Module window.
Please change "MoveRow" in the line Call MoveRow to the macro name you assigned to the shape, and then press the F5 key to run the code.
Thank you for your comment.

Sub Text()
Dim xShape As Shape
Dim xRg As Range
On Error Resume Next
Application.EnableEvents = False
Set xShape = ActiveSheet.Shapes("Rectangle 1")
If Not xShape Is Nothing Then
ActiveSheet.Hyperlinks.Add xShape, "", "A1", ScreenTip:="Click to run Macro "
End If
If ActiveSheet.Hyperlinks(1).SubAddress = "A1" Then
Call MoveRow
End If
Application.EnableEvents = True
End Sub
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations