I hope this is right
CODE
Sub data()
Dim prnone As Integer
Dim prntwo As Integer
Dim prnthree As Integer
Dim prnfour As Integer
Dim storenumber As Variant
Dim jnynumber As Variant
Dim specialsa As Variant
Dim mytime
With Worksheets("Input")
specialsa = .Cells(9, 2)
prnone = .Cells(9, 4)
prntwo = .Cells(10, 4)
prnthree = .Cells(11, 4)
prnfour = .Cells(12, 4)
storenumber = .Cells(9, 6)
jnynumber = .Cells(9, 8)
mytime = TimeValue("01:00")
Cells(9, 2).Value = "L"
Cells(9, 4).Value = ""
Cells(10, 4).Value = ""
Cells(11, 4).Value = ""
Cells(12, 4).Value = ""
Cells(9, 6).Value = ""
Cells(9, 8).Value = ""
Cells(9, 2).Activate
End With
With Worksheets("data")
currentrow = 2
currentcolumn = 17
If specialsa = "L" Then
Do
currentrow = currentrow + 1
Loop Until .Cells(currentrow, currentcolumn) = "" Or currentrow = 1100
If currentrow = 1100 Then
MsgBox "No Room"
Exit Sub
End If
.Cells(currentrow, currentcolumn) = specialsa
End If
currentrow = 2
currentcolumn = 17
If Not specialsa = "L" Then
Do
currentrow = currentrow + 1
Loop Until .Cells(currentrow, currentcolumn) = "" Or currentrow = 1100
If currentrow = 1100 Then
MsgBox "No Room"
Exit Sub
End If
.Cells(currentrow, currentcolumn) = specialsa
End If
With Worksheets("data")
currentrow = 2
currentcolumn = 7
If Not storenumber = 0 Then
Do
currentrow = currentrow + 1
Loop Until .Cells(currentrow, currentcolumn) = "" Or currentrow = 1100
If currentrow = 1100 Then
MsgBox "No Room"
Exit Sub
End If
.Cells(currentrow, currentcolumn) = storenumber
End If
End With
currentrow = 2
currentcolumn = 9
If Not jnynumber = 0 Then
Do
currentrow = currentrow + 1
Loop Until .Cells(currentrow, currentcolumn) = "" Or currentcolumn = 1100
If currentcoulmn = 1100 Then
MsgBox "No Room"
Exit Sub
End If
.Cells(currentrow, currentcolumn) = Time
End If
currentrow = 2
currentcolumn = 2
If Not jnynumber = 0 Then
Do
currentrow = currentrow + 1
currentcolumn = currentcolumn
Loop Until .Cells(currentrow, currentcolumn) = "" Or currentrow = 1100
If currentrow = 1100 Then
MsgBox "No Room"
Exit Sub
End If
.Cells(currentrow, currentcolumn) = jnynumber
End If
If Not prnone = 0 Then
Do
currentrow = currentrow
currentcolumn = currentcolumn + 1
Loop Until .Cells(currentrow, currentcolumn) = "" Or currentrow = 1100
If currentrow = 1100 Then
MsgBox "No Room"
Exit Sub
End If
.Cells(currentrow, currentcolumn) = prnone
End If
If Not prntwo = 0 Then
Do
currentrow = currentrow
currentcolumn = currentcolumn + 1
Loop Until .Cells(currentrow, currentcolumn) = "" Or currentrow = 1100
If currentrow = 1100 Then
MsgBox "No Room"
Exit Sub
End If
.Cells(currentrow, currentcolumn) = prntwo
End If
If Not prnthree = 0 Then
Do
currentrow = currentrow
currentcolumn = currentcolumn + 1
Loop Until .Cells(currentrow, currentcolumn) = "" Or currentrow = 1100
If currentrow = 1100 Then
MsgBox "No Room"
Exit Sub
End If
.Cells(currentrow, currentcolumn) = prnthree
End If
If Not prnfour = 0 Then
Do
currentrow = currentrow
currentcolumn = currentcolumn + 1
Loop Until .Cells(currentrow, currentcolumn) = "" Or currentrow = 1100
If currentrow = 1100 Then
MsgBox "No Room"
Exit Sub
End If
.Cells(currentrow, currentcolumn) = prnfour
End If
End With
ActiveWorkbook.Save
End Sub
Sub finishload()
Dim jnynumber As Variant
Dim nrps As Integer
Dim nbds As Integer
Dim prps As Integer
Dim pbds As Integer
Dim mytime
With Worksheets("Input")
jnynumber = .Cells(21, 3)
nrps = .Cells(21, 5)
nbds = .Cells(21, 6)
prps = .Cells(21, 7)
pbds = .Cells(21, 8)
mytime = TimeValue("01:00")
Cells(21, 3).Value = ""
Cells(21, 5).Value = ""
Cells(21, 6).Value = ""
Cells(21, 7).Value = ""
Cells(21, 8).Value = ""
Cells(21, 3).Activate
End With
Dim currentrow As Long
currentrow = 2
Dim currentcolumn As Long
currentcolumn = 2
With Worksheets("Data")
Do
currentrow = currentrow + 1
Loop Until .Cells(currentrow, currentcolumn) = "" Or .Cells(currentrow, currentcolumn) = jnynumber
If .Cells(currentrow, currentcolumn) = "" Then
MsgBox "Not Found"
Exit Sub
End If
.Cells(currentrow, 10) = nrps
End With
currentrow = 2
currentcolumn = 2
With Worksheets("Data")
Do
currentrow = currentrow + 1
Loop Until .Cells(currentrow, currentcolumn) = "" Or .Cells(currentrow, currentcolumn) = jnynumber
If .Cells(currentrow, currentcolumn) = "" Then
MsgBox "Not Found"
Exit Sub
End If
.Cells(currentrow, 11) = nbds
End With
currentrow = 2
currentcolumn = 2
With Worksheets("Data")
Do
currentrow = currentrow + 1
Loop Until .Cells(currentrow, currentcolumn) = "" Or .Cells(currentrow, currentcolumn) = jnynumber
If .Cells(currentrow, currentcolumn) = "" Then
MsgBox "Not Found"
Exit Sub
End If
.Cells(currentrow, 12) = prps
End With
currentrow = 2
currentcolumn = 2
With Worksheets("Data")
Do
currentrow = currentrow + 1
Loop Until .Cells(currentrow, currentcolumn) = "" Or .Cells(currentrow, currentcolumn) = jnynumber
If .Cells(currentrow, currentcolumn) = "" Then
MsgBox "Not Found"
Exit Sub
End If
.Cells(currentrow, 13) = pbds
End With
currentrow = 2
currentcolumn = 2
With Worksheets("Data")
Do
currentrow = currentrow + 1
Loop Until .Cells(currentrow, currentcolumn) = "" Or .Cells(currentrow, currentcolumn) = jnynumber
If .Cells(currentrow, currentcolumn) = "" Then
MsgBox "Not Found"
Exit Sub
End If
.Cells(currentrow, 14) = Time
End With
ActiveWorkbook.Save
End Sub