简体   繁体   English

如何使用VBA使Excel 2007中的单元格透明

[英]How to use VBA to make a cell in Excel 2007 transparent

I currently have: 我目前有:

Range("Z1").Interior.Color = RGB(255, 255, 255)

But this wipes out the borders of the cells. 但这消灭了细胞的边界。 Instead I'd just like to set the transparency of the cells in range to 1.0. 相反,我只想将范围内的单元格透明度设置为1.0。 The docs seem to suggest it doesn't exist (?). 文档似乎暗示它不存在(?)。

Thanks! 谢谢!

Range("Z1").Interior.ColorIndex = xlNone

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Cells.Count > 1 Then Exit Sub
    Application.ScreenUpdating = False
    ' Clear the color of all the cells
    Cells.Interior.ColorIndex = 0
    With Target
        ' Highlight the entire row and column that contain the active cell
        .EntireRow.Interior.ColorIndex = 8
        .EntireColumn.Interior.ColorIndex = 8
    End With
    Application.ScreenUpdating = True
End Sub

也许一个简单的方法是(Symbol).(line or background)Color = -1 'Transparent

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM