|
- Sub 录入保存()
- Dim intS As Integer, Myr%
- Dim rngC As Range
- Dim strToFind As String, FirstAddress As String
- Dim wSht As Worksheet
- Application.ScreenUpdating = False
- intS = 1
- Set wSht = Worksheets("记录")
- ' Myr = wSht.[c65536].End(xlUp).Row + 1
- For i = 5 To 9
- Myr = wSht.[c65536].End(xlUp).Row + 1
- If Cells(i, 1) <> "" Then
- With wSht
- .Cells(Myr, 3) = [c3].Value
- .Cells(Myr, 4) = [f3].Value
- .Cells(Myr, 5) = Cells(i, 1)
- .Cells(Myr, 6) = Cells(i, 2)
- .Cells(Myr, 7) = Cells(i, 3)
- .Cells(Myr, 8) = Cells(i, 4)
- .Cells(Myr, 9) = Cells(i, 5)
- .Cells(Myr, 10) = Cells(i, 6)
- .Cells(Myr, 11) = Cells(i, 7)
- .Cells(Myr, 12) = Cells(i, 8)
- End With
- Sheets("录入").Range("A5:B9,D5:H9").ClearContents
- Sheets("录入").Range("F3").Value = Sheets("录入").Range("F3").Value + 1
- End If
- Next i
- Application.ScreenUpdating = True
- End Sub
复制代码 另:你的代码写的忒过复杂了点。。 |
|