G
Guest
Hi. Hopefully someone can help me out here. Have a file with 3 sheets. Sheet
1 (In-Store) is where daily information is inputted. At the end of the night
I need to be able to click on "Run Sales Book" and have information from
sheet 1 transferred over to sheets 2 (Y.T.D.) and 3 (Payroll) based on the
date. The first part works. it transfers my data over onto the Y.T.D. sheet
without a problem. The payroll sheet is causing me a headache. It is not
transferring over the information at all. It's not even telling me any
errors. Now the first part searches for a date and inputs the data I need
over on the same row-different column. The payroll one searches for a date
and inputs the data I need below the date 2 rows down (same column-different
row). What am I doing wrong? Below is what I have.
Sub Run_Sales_Book()
' Entering info Y.T.D., Payroll, WIR
Sheets("In-Store").Select
Range("C4").Select
Dim dateSearch As Date
On Error Resume Next
' Check for Correct Date
checkdate = MsgBox("Is the correct date entered in your DSR?", vbYesNo,
C4)
If checkdate = 7 Then
MsgBox ("Enter the Correct Date (e.g. Christmas = 12/25/01)")
Exit Sub
Else
dateSearch = Sheets("In-Store").Range("C4")
Sheets("Y.T.D.").Select
Range("H6").Select
Range(ActiveCell, "H421").Select
Selection.Find(dateSearch).Select
If Selection.Find(dateSearch) = False Then
Range("A1").Select
MsgBox ("Could not find that Date. Ensure that the date is
entered in the proper format (e.g. 12/25/01 = Christmas)")
Exit Sub
End If
End If
' Entering Sales by Shift
' Days
ActiveCell.Offset(0, 2).Select
ActiveCell.Formula = Sheets("In-Store").Range("C11")
' Nights
ActiveCell.Offset(0, 1).Select
ActiveCell.Formula = Sheets("In-Store").Range("D11")
'Entering Payroll Information
Sheets("Payroll").Select
Range("C12").Select
Range(ActiveCell, "AF12").Select
Selection.Find(dateSearch).Select
If Selection.Find(dateSearch) = False Then
Range("A1").Select
MsgBox ("Could not find that Date. Ensure that the date is
entered in the proper format (e.g. 12/25/01 = Christmas)")
Exit Sub
End If
' Payrol
ActiveCell.SmallScroll Down:=2
ActiveCell.Formula = Sheets("In-Store").Range("AB30:aB50")
1 (In-Store) is where daily information is inputted. At the end of the night
I need to be able to click on "Run Sales Book" and have information from
sheet 1 transferred over to sheets 2 (Y.T.D.) and 3 (Payroll) based on the
date. The first part works. it transfers my data over onto the Y.T.D. sheet
without a problem. The payroll sheet is causing me a headache. It is not
transferring over the information at all. It's not even telling me any
errors. Now the first part searches for a date and inputs the data I need
over on the same row-different column. The payroll one searches for a date
and inputs the data I need below the date 2 rows down (same column-different
row). What am I doing wrong? Below is what I have.
Sub Run_Sales_Book()
' Entering info Y.T.D., Payroll, WIR
Sheets("In-Store").Select
Range("C4").Select
Dim dateSearch As Date
On Error Resume Next
' Check for Correct Date
checkdate = MsgBox("Is the correct date entered in your DSR?", vbYesNo,
C4)
If checkdate = 7 Then
MsgBox ("Enter the Correct Date (e.g. Christmas = 12/25/01)")
Exit Sub
Else
dateSearch = Sheets("In-Store").Range("C4")
Sheets("Y.T.D.").Select
Range("H6").Select
Range(ActiveCell, "H421").Select
Selection.Find(dateSearch).Select
If Selection.Find(dateSearch) = False Then
Range("A1").Select
MsgBox ("Could not find that Date. Ensure that the date is
entered in the proper format (e.g. 12/25/01 = Christmas)")
Exit Sub
End If
End If
' Entering Sales by Shift
' Days
ActiveCell.Offset(0, 2).Select
ActiveCell.Formula = Sheets("In-Store").Range("C11")
' Nights
ActiveCell.Offset(0, 1).Select
ActiveCell.Formula = Sheets("In-Store").Range("D11")
'Entering Payroll Information
Sheets("Payroll").Select
Range("C12").Select
Range(ActiveCell, "AF12").Select
Selection.Find(dateSearch).Select
If Selection.Find(dateSearch) = False Then
Range("A1").Select
MsgBox ("Could not find that Date. Ensure that the date is
entered in the proper format (e.g. 12/25/01 = Christmas)")
Exit Sub
End If
' Payrol
ActiveCell.SmallScroll Down:=2
ActiveCell.Formula = Sheets("In-Store").Range("AB30:aB50")