+ Reply to Thread
Results 1 to 1 of 1

Time Sheet Printing from Excel

  1. #1
    Registered User
    Join Date
    07-10-2009
    Location
    PNG
    MS-Off Ver
    Excel 2003
    Posts
    3

    Question Time Sheet Printing from Excel

    Hi.

    I am trying to take the name of an employee from column A on sheet named "DATA" and place it in B8 on sheet called "TIME_SHEET"
    Then
    I am trying to take the pay band of the employee from column B on sheet named "DATA" and place it in B10 on sheet called "TIME_SHEET"

    I have a lot of employeesand there data is set out on the sheet "DATA"

    Row 1 Cell A Employee name Row 1 Cell B Employee Pay Band.

    Below is my code (at which I am not to good at)

    I am unable to get it to loop to allow me to print off each members pay sheet with the fields filled out.

    Option Explicit
    Sub PRINT_TIME_SHEET()

    Dim myCell As Range
    Dim myCell2 As Range
    Dim myNamesRng As Range
    Dim myNamesRng2 As Range
    Dim myHeaderCell As Range
    Dim myHeaderCell2 As Range


    With Worksheets("DATA")
    Set myNamesRng = .Range("a1", .Cells(.Rows.Count, "A").End(xlUp))
    Set myNamesRng2 = .Range("b1", .Cells(.Rows.Count, "B").End(xlUp))
    End With

    With Worksheets("TIME_SHEET")
    Set myHeaderCell = .Range("b8")
    Set myHeaderCell2 = .Range("b10")


    For Each myCell In myNamesRng.Cells
    myHeaderCell.Value = myCell.Value

    For Each myCell2 In myNamesRng2.Cells
    myHeaderCell2.Value = myCell2.Value

    .PrintOut preview:=True
    Next myCell



    myHeaderCell2.ClearContents
    myHeaderCell.ClearContents

    End With

    End Sub
    Attached Files Attached Files
    Last edited by voigtsy; 06-15-2012 at 05:36 AM. Reason: File Attached

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1