Cut/Paste row with specific condition

claude007

New Member
Joined
Feb 6, 2020
Messages
1
Office Version
  1. 2019
Platform
  1. Windows
Hello Team,
am ready reach to a point that am stuck, cant find the proper solution, so i want some help from your expertise.
basically i have 2 sheet, current employee (sheet1) and leaver employee (sheet2), to move the employee from sheet1 to 2 very simple, i use
VBA Code:
ActiveCell.EntireRow.Cut Sheets("Sheet2").Range("A65536").End(xlUp).Offset(1, 0)
ActiveCell.EntireRow.Delete
that move to the end row the employee leaving, however if the employee withdraw, i want to create the button in sheet2 to putting back the employee back in his specific row based on his employee number not at the end of the sheet ..
example,
1 - nameOF1stEmployee - HisDepartment-Age1
2 - nameOF2ndEmployee - HisDepartment-Age2
3 - nameOF3rdEmployee - HisDepartment-Age3
4 - nameOF4thEmployee - HisDepartment-Age4
5 - nameOF5thEmployee - HisDepartment-Age5
6 - nameOF6thEmployee - HisDepartment-Age6
7 - nameOF7thEmployee - HisDepartment-Age7

so to remove the 4th employee, i easily remove him using the above code at the end of sheet2, however if i want to bring him bacl to sheet 1 between 3rd and 5th employee, i cant do it, please help.
thank you
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,223,719
Messages
6,174,089
Members
452,542
Latest member
Bricklin

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