LoginSignup
1

More than 3 years have passed since last update.

Excel VBAでリモート会議に使用するExcelシートで、説明している行を強調表示してみた

Posted at

Excel VBAでリモート会議に使用するExcelシートで、説明している行を強調表示してみた

Excelでいま説明しているところを、キーボードやマウスで移動して、見ている人に今どこを説明しているかを示すためのマクロを試しに作成。

ここでは、セルA~C列に入力されているタイトルをクリックした行だけ赤いボールド文字で表示するようにしてみた。
Book1 - Excel 2020_05_11 14_33_05.png

Dim maeCurRow

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    If IsEmpty(maeCurRow) Then maeCurRow = 1

    With Range("$A$" & Target.Row & ":$C$" & Target.Row).Font
        .Bold = True
        .Color = -16776961
    End With

    If maeCurRow <> Target.Row Then
        maeRange = "$A$" & maeCurRow & ":$C$" & maeCurRow
        With Range(maeRange).Font
            .ColorIndex = xlAutomatic
            .Bold = False
        End With
    End If

    maeCurRow = Target.Row

End Sub

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
1