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
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
Last edited by svippala; 08-05-2014 at 01:03 AM.
Here is your code
1) You confused sheets. I fixed it.Please Login or Register to view this content.
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.
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.
just replace your code with mine
I replace with your code create the All the employees payslip but data is not updated in payslip.....
hi Original sheet
check file
OK, now I see. This works
Please Login or Register to view this content.
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.
You have 2 emloyees named Rajesh. The slip will be overwritten.
Please Login or Register to view this content.
working fine but created PDf files mahi(0020) but i need the only the mahi....
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.
Thanks very much .. One more question how to indicate the file PDF files Name and month ex. Rajesh_Jan-2014.
Please Login or Register to view this content.
Thanks working Great job
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.
1) put you code into spoiler plz
2) change the "FIGURE = amt" to "FIGURE = Round(amt, 0)"
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
Ok Thanks lancer
Sorry for above mistake further not repeat again ..
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks