• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Insert cut row in protected range of rows

a_27826

Junior Member
I need help.

I need a VBA code for a worksheet to automatically insert cut paste a row from a range of unprotected rows to the range of protected rows once the user decides to do so.

I have a sheet called “Customer Stock” which has two tables called “Uncollected” and “Collected”.

I need “Uncollected” table to be unprotected and “Collected” Table to be protected.

Once the a Customer collects the goods, the user can cut and insert the collected row from the unprotected “uncollected” table to just above the first row of the protected “collected” table.

so that the inserted cut row now should be protected.

The password should be 1234 and the user won’t know the password. Only the administrator will be having it.
 
This should do the trick

Code:
ActiveSheet.Unprotect Password:="1234"
Dim jayrow As Integer
jayrow = 123
Rows(jayrow).Select     
Selection.Cut
Rows(456).Activate
ActiveCell.EntireRow.Insert
ActiveSheet.Protect Password:="1234"

You gotta modify something but this is the general idea.
 
Back
Top