|
我在Excel VBA中写了一个给excel表录入记录的小程序 如何在点“按钮”后自动为新录入内容的单元格画上边框 谢谢指教
如图 下边新增内容都没有边框
- Private Sub Worksheet_Change(ByVal Target As Range)
- With Target
- If .Count > 1 Then Exit Sub
- If .Row < 5 Then Exit Sub
- If .Column <> 1 Then Exit Sub
- If .Value = "" Then
- Range(Cells(.Row, "A"), Cells(.Row, "I")).Borders.LineStyle = 0
- Else
- Range(Cells(.Row, "A"), Cells(.Row, "I")).Borders.LineStyle = 1
- End If
- End With
- End Sub
复制代码
|
|