A CHALLENGING TASK, NEED HELP WITH THIS PROBLEM

Fimwizard

New Member
Joined
Mar 1, 2004
Messages
7
I created a payroll workbook that calculates the hours daily for each employee. The problem is that when it's time to make another workbook for the next payperiod I would like the terminated employee not to show and leave the current one. These pages are linked to other sheets, but not to other workbooks.

Sample:

Employee name Dept ID rate Status

John Doe 0002 0008 7.50
Jane Doe 0002 0001 8.50
Jimmy Doe 0002 1254 9.00 Term

So when the user saves and copies workbook only the current employees with their link data would remain in the new workbook
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

DRJ

MrExcel MVP
Joined
Feb 17, 2002
Messages
3,853
you can try something like this, Lets say their status is in column E.

Sub DeleteTerm()

dim x as long
dim LastRow as long

lastrow = range("A65536").end(xlup).row

for x = 1 to lastrow
if range("E" & x).value = "Term" then
rows(x & ":" & x).delete
else
end if
next x

end sub

Hope this helps

Jacob
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,102
Messages
5,768,102
Members
425,454
Latest member
khoro

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
Top