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

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
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,214,918
Messages
6,122,257
Members
449,075
Latest member
staticfluids

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