snasui.com ยินดีต้อนรับ ยินดีต้อนรับสู่กระดานถามตอบ Excel and VBA และอื่น ๆ ที่เป็นมิตรกับทุกท่าน มีไฟล์แนบมหาศาล ช่วยให้ท่านค้นหาและติดตามศึกษาได้โดยง่าย สมาชิกท่านใดที่ยังไม่ได้ระบุ Version ของ Excel ที่ใช้งานจริง สามารถทำตาม Link นี้เพื่อจะได้รับคำตอบที่ตรงกับ Version ของท่านครับ ระบุ Version ของ Excel
Sub Nextdata()
If Sheets("Data").Cells(ActiveCell.Row + 1, 1) = Empty Then
MsgBox "Can not go to the next data. ... this last one."
GoTo NextStep
End If
nextRow = ActiveCell.Row + 1
Cells(nextRow, 1).Activate
Sheets("Input").Range("C4").Value = Sheets("Data").Cells(nextRow, 2)
Sheets("Input").Range("C6").Value = Sheets("Data").Cells(nextRow, 3)
Sheets("Input").Range("C8").Value = Sheets("Data").Cells(nextRow, 4)
Sheets("Input").Range("C10").Value = Sheets("Data").Cells(nextRow, 5)
NextStep:
End Sub
Sub Previousdata()
If Sheets("Data").Cells(ActiveCell.Row - 1, 1) = "ON" Then
MsgBox "Can not go to the previous data. ... this last one."
GoTo NextStep
End If
nextRow = ActiveCell.Row - 1
Cells(nextRow, 1).Activate
Sheets("Input").Range("C4").Value = Sheets("Data").Cells(nextRow, 2)
Sheets("Input").Range("C6").Value = Sheets("Data").Cells(nextRow, 3)
Sheets("Input").Range("C8").Value = Sheets("Data").Cells(nextRow, 4)
Sheets("Input").Range("C10").Value = Sheets("Data").Cells(nextRow, 5)
NextStep:
End Sub
You do not have the required permissions to view the files attached to this post.