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

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
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,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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