点插入按钮后,插入不在表格下面,而在表格什么是什么原因?如何改正。谢谢!点单元格也不变色。
Private Sub CommandButton1_Click()
Dim i%
Sheets("期数表").Activate
i = WorksheetFunction.Count([a:a], "<>") + 2
Sheets("期数表").Rows(i + 1).Insert
Range("A" & i + 1, "Cy" & i).Formula = Range("A" & i, "dt" & i).Formula
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim i%
i = WorksheetFunction.Count([a:a], "<>") + 2
Set Rng = Application.Intersect(Target, Range(Cells(i + 1, "x"), Cells(i + 3, "dt")))
If Not Rng Is Nothing Then
If Rng.Interior.Color = vbRed Then
Rng.Interior.ColorIndex = xlNone
Else
Rng.Interior.Color = vbRed
End If
End If
[A1].Select
End Sub
本主题由 十一层 于 2021-02-27 22:13 审核通过