发布网友 发布时间:2022-11-21 23:49
共1个回答
热心网友 时间:2024-12-12 10:58
设置一个公用变量,在Worksheet_SelectionChange中把选定区域付给这个变量,下次改变时访问这个公用变量就行了追问补充了问题 继续请教 请答疑追答Public myrang As Range
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not myrange = Empty Then
myrange.Font.Size = 10
myrange.Interior.ThemeColor = xlThemeColorDark1
End If
Target.Font.Size = 20
Target.Interior.ThemeColor = xlThemeColorAccent6
myrange = Target
End Sub