Sorting payroll worksheet alphabetically using VBA

jeevesk

New Member
Joined
Jul 16, 2016
Messages
1
[FONT=&quot]Hi,

I have almost no knowledge of VBA, and need help with this.

I have a payroll spreadsheet with monthly worksheets containing employee codes, names, hours worked per day, overtime calculations, Sunday pay calculations, etc. I need help with the ffg:[/FONT]

[FONT=&quot] [/FONT]
[FONT=&quot]1. For every month's worksheet I need to delete the employees that were terminated the previous month, and add in any new employees and then sort the sheet alphabetically by employee code. How would I do this?[/FONT]
[FONT=&quot]2. Overtime for last month is paid this month, so when the new month's sheet is sorted alphabetically as above, I need to find the relevant employees overtime from last month and pull it across to a cell in this month's sheet, considering that the cell references need to change according to the mentioned deletion and addition of employees.
3. There are several cells in the current month that lookup cells on the previous month's sheet, I need a macro to find and replace the reference names, eg. May!2016 to June!2016 on the newly created worksheet.

Thank you in advance for your assistance.

Kind regards,
JeevesK [/FONT]
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,215,365
Messages
6,124,513
Members
449,168
Latest member
CheerfulWalker

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top