LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Problem with code

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")

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Little problem with this code... simonsmith Excel Discussion (Misc queries) 11 May 21st 06 04:02 AM
Can anyone see the problem with this code? Cody Excel Programming 5 July 21st 05 11:23 PM
Problem with code Steve[_71_] Excel Programming 2 December 12th 04 03:47 PM
Code problem Rick[_11_] Excel Programming 1 August 8th 03 04:25 AM
Code Problem ! Mike R Excel Programming 5 August 5th 03 03:35 PM


All times are GMT +1. The time now is 05:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"