+ Reply to Thread
Results 1 to 19 of 19

Macro To save as PDF of employee payslips

  1. #1
    Registered User
    Join Date
    07-24-2014
    Location
    hyd
    MS-Off Ver
    2010
    Posts
    13

    Macro To save as PDF of employee payslips

    Can you plz help I am attach the code file when i run the vba only one employee files is created I need all the employees Payslips
    Attached Files Attached Files
    Last edited by svippala; 08-05-2014 at 01:03 AM.

  2. #2
    Forum Contributor lancer102rus's Avatar
    Join Date
    04-02-2014
    Location
    Ufa
    MS-Off Ver
    Excel 2010, 2013
    Posts
    252

    Re: Macro To save as PDF of employee payslips

    Here is your code
    Please Login or Register  to view this content.
    1) You confused sheets. I fixed it.
    2) in your example you have 2 Rajesh. creating file with name only from column "Salary Slip for the month of" you will overwrite first payslist (unlucky Operations Manager Rajesh :-)). I added employee code to the file name.
    Last edited by lancer102rus; 08-05-2014 at 01:46 AM.

  3. #3
    Registered User
    Join Date
    07-24-2014
    Location
    hyd
    MS-Off Ver
    2010
    Posts
    13

    Re: Macro To save as PDF of employee payslips

    you code is working and create the All the employees payslip but data is not updated in payslip.....
    hi Original code
    Option Explicit

    ' print payslip for all selected employees
    ' uses the selected rows
    Sub PrintPaySlips()
    Dim rCl As Range
    Dim rRng As Range
    With Sheet1
    Set rRng = .Range(.Cells(5, 1), .Cells(.Rows.Count, 1).End(xlUp))
    For Each rCl In rRng
    With Sheet2
    .Cells(1, 2).Value = rCl.Value
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
    Filename:="E:\Payslips\" & Range("B3").Value & ".pdf", _
    Quality:=xlQualityStandard, IncludeDocProperties:=True, _
    IgnorePrintAreas:=False, OpenAfterPublish:=False
    End With
    Next rCl

    End With
    End Sub

    when i create the pay slips using this code create only one employes only I need all employees Payslips wtih SalaryCalculation
    Last edited by svippala; 08-05-2014 at 02:11 AM.

  4. #4
    Forum Contributor lancer102rus's Avatar
    Join Date
    04-02-2014
    Location
    Ufa
    MS-Off Ver
    Excel 2010, 2013
    Posts
    252

    Re: Macro To save as PDF of employee payslips

    just replace your code with mine

  5. #5
    Registered User
    Join Date
    07-24-2014
    Location
    hyd
    MS-Off Ver
    2010
    Posts
    13

    Re: Macro To save as PDF of employee payslips

    I replace with your code create the All the employees payslip but data is not updated in payslip.....
    hi Original sheet

  6. #6
    Registered User
    Join Date
    07-24-2014
    Location
    hyd
    MS-Off Ver
    2010
    Posts
    13

    Re: Macro To save as PDF of employee payslips

    check file
    Attached Files Attached Files

  7. #7
    Forum Contributor lancer102rus's Avatar
    Join Date
    04-02-2014
    Location
    Ufa
    MS-Off Ver
    Excel 2010, 2013
    Posts
    252

    Re: Macro To save as PDF of employee payslips

    OK, now I see. This works
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    07-24-2014
    Location
    hyd
    MS-Off Ver
    2010
    Posts
    13

    Re: Macro To save as PDF of employee payslips

    Thanks Now working fine. I Need one more request Files name Should be Employees name only. after completion of creating the pay slips Give me message done! PDf page should be single page.

  9. #9
    Forum Contributor lancer102rus's Avatar
    Join Date
    04-02-2014
    Location
    Ufa
    MS-Off Ver
    Excel 2010, 2013
    Posts
    252

    Re: Macro To save as PDF of employee payslips

    Quote Originally Posted by svippala View Post
    ...Files name Should be Employees name only...
    You have 2 emloyees named Rajesh. The slip will be overwritten.
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    07-24-2014
    Location
    hyd
    MS-Off Ver
    2010
    Posts
    13

    Re: Macro To save as PDF of employee payslips

    working fine but created PDf files mahi(0020) but i need the only the mahi....

  11. #11
    Forum Contributor lancer102rus's Avatar
    Join Date
    04-02-2014
    Location
    Ufa
    MS-Off Ver
    Excel 2010, 2013
    Posts
    252

    Re: Macro To save as PDF of employee payslips

    Do you hear me? I think it is a big problem: the slip for Rajesh #5 will be rewritten by slip for Rajesh #12. Do you anderstand this?
    Anyway, if you want so then
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    07-24-2014
    Location
    hyd
    MS-Off Ver
    2010
    Posts
    13

    Re: Macro To save as PDF of employee payslips

    Thanks very much .. One more question how to indicate the file PDF files Name and month ex. Rajesh_Jan-2014.

  13. #13
    Forum Contributor lancer102rus's Avatar
    Join Date
    04-02-2014
    Location
    Ufa
    MS-Off Ver
    Excel 2010, 2013
    Posts
    252

    Re: Macro To save as PDF of employee payslips

    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    07-24-2014
    Location
    hyd
    MS-Off Ver
    2010
    Posts
    13

    Re: Macro To save as PDF of employee payslips

    Thanks working Great job

  15. #15
    Registered User
    Join Date
    07-24-2014
    Location
    hyd
    MS-Off Ver
    2010
    Posts
    13

    Re: Macro To save as PDF of employee payslips

    hi lancer Can you Please help one more i am using below code is convet the number to word grate but I need some updated on this

    in Paise values round up values .

    If 9677.49 =Rupees Nine Thousand Six Hundred SeventySeven Only
    If 9677.50 =Rupees Nine Thousand Six Hundred SeventyEight Only
    Last edited by svippala; 08-07-2014 at 12:29 AM.

  16. #16
    Forum Contributor lancer102rus's Avatar
    Join Date
    04-02-2014
    Location
    Ufa
    MS-Off Ver
    Excel 2010, 2013
    Posts
    252

    Re: Macro To save as PDF of employee payslips

    1) put you code into spoiler plz
    2) change the "FIGURE = amt" to "FIGURE = Round(amt, 0)"

  17. #17
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Macro To save as PDF of employee payslips

    Hi, svippala,

    Your post #3 and post #15 do not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  18. #18
    Registered User
    Join Date
    07-24-2014
    Location
    hyd
    MS-Off Ver
    2010
    Posts
    13

    Re: Macro To save as PDF of employee payslips

    Ok Thanks lancer

  19. #19
    Registered User
    Join Date
    07-24-2014
    Location
    hyd
    MS-Off Ver
    2010
    Posts
    13

    Re: Macro To save as PDF of employee payslips

    Sorry for above mistake further not repeat again ..

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro To save as PDF of employee payslips
    By yemnirmal in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 08-31-2015, 07:59 PM
  2. Save payslips as pdf
    By crychnun in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-06-2012, 01:40 PM
  3. [SOLVED] Generate payslips of employee on a list
    By oluwafog in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 04-17-2012, 11:16 PM
  4. Templates/payslips/macros
    By Erve in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-05-2010, 12:31 PM
  5. Creating payslips
    By si_ako in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-01-2007, 01:32 AM

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