Quantcast
Channel: Excel | You Look Too Cool
Viewing all articles
Browse latest Browse all 54

ハイパーリンクがあるセルに網かけをするマクロ

$
0
0

以前、ハイパーリンクの有無を判定するユーザー定義関数を紹介しました。
今回は同じ仕組みを使い、ハイパーリンクがあるセルに網かけをするマクロを作りました。

色は「vbYellow」の所で設定します。
カラー定数 | Microsoft Docs

Sub 選択範囲のハイパーリンクがあるセルに網かけ()
  Dim c As Object
  For Each c In Selection
    If c.Hyperlinks.Count > 0 Then
      With c.Interior
        .Pattern = xlSolid
        .Color = vbYellow
      End With
    Else
      With c.Interior
        .Pattern = xlNone
      End With
    End If
  Next c
End Sub

Viewing all articles
Browse latest Browse all 54

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>