+ Reply to Thread
Results 1 to 5 of 5

Payroll Spreadsheet

Hybrid View

Sirishgreen Payroll Spreadsheet 09-22-2007, 10:01 AM
mrice Try the attached macro 09-22-2007, 12:47 PM
Sirishgreen nearly there! 09-22-2007, 09:12 PM
mrice Replace with this amended... 09-23-2007, 10:11 AM
Sirishgreen thankyou 09-24-2007, 07:25 AM
  1. #1
    Forum Contributor
    Join Date
    09-21-2007
    Posts
    126

    Payroll Spreadsheet

    ok guys I need your help.

    Im doing a spreadsheet for payroll.

    I want to be able to select a month and a year from 2 cells, then have the spreadsheet pull 21st of that month to the 20th of the next month and display them dates with the days of the week next to them.

    or a possiblity is that they extra cells be locked at the minute i cant seem to find a way of doing it.

    thanks in advance.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    Try the attached macro
    Attached Files Attached Files
    Martin

  3. #3
    Forum Contributor
    Join Date
    09-21-2007
    Posts
    126

    nearly there!

    works a treat,

    Just 1 thing febuary isnt working properly, listing to many days

    can see now by the macro i had no chance doing that on my own.

    is it possible to change it to account for feb,

    thanks alot Martin

    Simon

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    Replace with this amended macro

    Sub Test()
    Range(Cells(2, 4), Cells(65536, 5)).Clear
    For N = 21 To 51
        If Cells(2, 1) = 2 And N >= 50 Then Exit For
        If Day(DateSerial(Cells(2, 2), Cells(2, 1), N)) <> 21 Then
            Cells(65536, 4).End(xlUp).Offset(1, 0) = DateSerial(Cells(2, 2), Cells(2, 1), N)
        ElseIf N = 21 Then
            Cells(65536, 4).End(xlUp).Offset(1, 0) = DateSerial(Cells(2, 2), Cells(2, 1), N)
        End If
        Select Case Weekday(DateSerial(Cells(2, 2), Cells(2, 1), N))
            Case Is = 1
                Cells(65536, 4).End(xlUp).Offset(0, 1) = "Sunday"
            Case Is = 2
                Cells(65536, 4).End(xlUp).Offset(0, 1) = "Monday"
            Case Is = 3
                Cells(65536, 4).End(xlUp).Offset(0, 1) = "Tuesday"
            Case Is = 4
                Cells(65536, 4).End(xlUp).Offset(0, 1) = "Wednesday"
            Case Is = 5
                Cells(65536, 4).End(xlUp).Offset(0, 1) = "Thursday"
            Case Is = 6
                Cells(65536, 4).End(xlUp).Offset(0, 1) = "Friday"
            Case Is = 7
                Cells(65536, 4).End(xlUp).Offset(0, 1) = "Saturday"
        End Select
    Next N
    End Sub

  5. #5
    Forum Contributor
    Join Date
    09-21-2007
    Posts
    126

    thankyou

    thanks alot I really appreciate it,

    gonna make doing payroll a whole lot easier.

    Thanks again Martin

+ 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