A way to move a cell's value under or above another cell in a Protected Sheet

NiT3Tr4cK3r

New Member
Joined
Jun 13, 2019
Messages
1
So I got an excel file where within I got a list of Perks from a game. Now the problem is, when the sheet is Protected, the function to move a cell's value(the perk names in this case) under or above another perk in the list. Is there a way to enable the ability to use this feature somehow whilst keeping the Protection? (This is the function I mean: https://www.addictivetips.com/microsoft-office/how-to-swap-values-between-cells-rows-or-columns-in-ms-excel/)

The reason the file is protected is because there are only certain cells of columns other people should be able to edit, such as this list.

p.s. Sorry if this is asked in the past, I couldn't find it.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Welcome to the Board!

It looks like you cannot do this with Worksheet Protection on. If you do not want to turn it off, then you would be better off creating your own VBA procedure to do the swap. i.e.
Code:
Sub SwapCells()

    Dim cell1 As String, cell2 As String
    Dim val1, val2
    
'   Prompts to ask which cells to swap
    cell1 = InputBox("Enter address of first cell to swap")
    cell2 = InputBox("Enter address of second cell to swap")
    
    On Error GoTo err_chk
    
'   Capture values of cells
    val1 = Range(cell1).Value
    val2 = Range(cell2).Value
    
'   Swap values
    Range(cell1).Value = val2
    Range(cell2).Value = val1

    Exit Sub
    
err_chk:
        MsgBox "You have not entered a valid cell address or entered an address in the protected range", vbOKOnly, "ENTRY ERROR!"
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,157
Members
453,021
Latest member
Justyna P

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