Sub Input_Availability()
Application.ScreenUpdating = False
findvalue = Sheets("MyStoreInfo").ComboBox1.Value
If Sheets("MyStoreInfo").CheckBox1.Value = True Then
Box = "O"
End If
If Sheets("MyStoreInfo").CheckBox2.Value = True Then
Box = "P"
End If
If Sheets("MyStoreInfo").CheckBox3.Value = True Then
Box = "R"
End If
On Error GoTo finish
Range("Q10:AD49").Select
Selection.Find(What:=findvalue, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=True _
, SearchFormat:=False).Activate
On Error GoTo 0
RowNum = ActiveCell.row
ColNum = ActiveCell.Column
For r = 1 To 7
If Cells(RowNum + r, ColNum) = "" Then
Cells(RowNum + r, ColNum) = Range("B10") & " " & Range("C10")
Cells(RowNum + r, ColNum + 1) = Box
'begin part that inputs the letter to Schedule Template
FindName = Sheets("MyStoreInfo").Range("B10") & " " & Sheets("MyStoreInfo").Range("C10")
FindNumber = Sheets("MyStoreInfo").ComboBox1.Value
If Sheets("MyStoreInfo").CheckBox1.Value = True Then
Box = "O"
End If
If Sheets("MyStoreInfo").CheckBox2.Value = True Then
Box = "P"
End If
If Sheets("MyStoreInfo").CheckBox3.Value = True Then
Box = "R"
End If
Sheets("Schedule Tool").Visible = True
Sheets("Schedule Tool").Select
Columns("A:A").Select
Range("A3").Activate
On Error GoTo 0
Selection.Find(What:=FindNumber, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Selection.FindNext(After:=ActiveCell).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Find(What:=FindName, After:=ActiveCell, LookIn:= _
xlValues, LookAt:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Select
RowNum = ActiveCell.row
ColNum = ActiveCell.Column
Cells(RowNum, ColNum + 88) = Box
Sheets("Schedule Tool").Visible = False
'end part that inputs the letter to Schedule Template
Sheets("MyStoreInfo").Select
Range("Q8").Select
Application.ScreenUpdating = True
Exit Sub
Else
If r = 7 Then
Application.ScreenUpdating = True
MsgBox ("No more room")
Exit Sub
End If
End If
Next
finish:
Err.Clear
MsgBox ("Date not found")
End Sub