|
- Sub 上一条()
- Dim rng As Range
- Set rng = Sheets("A").Columns(1).Find(Sheets("B").[C9].Value, lookat:=xlWhole)
- If Not rng Is Nothing Then
- If rng.Row = 2 Then
- MsgBox "已至顶行"
- Else
- lr = rng.Offset(-1, 0).Row
- With Sheets("A")
- Sheets("B").[C9] = rng.Offset(-1, 0)
- Sheets("B").[B2] = rng.Offset(-1, 0)
- Sheets("B").[D2] = .Cells(lr, "B")
- Sheets("B").[B3] = .Cells(lr, "C")
- Sheets("B").[B4] = .Cells(lr, "D")
- Sheets("B").[D4] = .Cells(lr, "H")
- Sheets("B").[B5] = .Cells(lr, "E")
- Sheets("B").[D5] = .Cells(lr, "F")
- Sheets("B").[B6] = .Cells(lr, "G")
- End With
- End If
- Else
- MsgBox "代码不存在"
- End If
- End Sub
- Sub 下一条()
- Dim rng As Range
- Set rng = Sheets("A").Columns(1).Find(Sheets("B").[C9].Value, lookat:=xlWhole)
- lrd = Sheets("A").[A65536].End(xlUp).Row
- If Not rng Is Nothing Then
- If rng.Row = lrd Then
- MsgBox "已至尾行"
- Else
- lr = rng.Offset(1, 0).Row
- With Sheets("A")
- Sheets("B").[C9] = rng.Offset(1, 0)
- Sheets("B").[B2] = rng.Offset(1, 0)
- Sheets("B").[D2] = .Cells(lr, "B")
- Sheets("B").[B3] = .Cells(lr, "C")
- Sheets("B").[B4] = .Cells(lr, "D")
- Sheets("B").[D4] = .Cells(lr, "H")
- Sheets("B").[B5] = .Cells(lr, "E")
- Sheets("B").[D5] = .Cells(lr, "F")
- Sheets("B").[B6] = .Cells(lr, "G")
- End With
- End If
- Else
- MsgBox "代码不存在"
- End If
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|