Maybe I am missing this, but .......
Is there a way to just swap two cells? A way to select say c4 and c6, just hit a swap button or hot key?
Thanks
Maybe I am missing this, but .......
Is there a way to just swap two cells? A way to select say c4 and c6, just hit a swap button or hot key?
Thanks
Hi!
Yes: using VBA/macros.
The following by JE McGimpsey does the job. Set up a button or trigger of some kind. Select 2 cells while holding down the ctrl key. Run it. Run it again to toggle back to where you started.
Public Sub SwapCells()
Dim vTemp As Variant
With Selection
If .Count <> 2 Then
MsgBox "2 cells only."
Else
If .Areas.Count = 2 Then
vTemp = .Areas(1).Cells.Value
.Areas(1).Cells.Value = .Areas(2).Cells.Value
.Areas(2).Cells.Value = vTemp
Else
vTemp = .Cells(1).Value
.Cells(1).Value = .Cells(2).Value
.Cells(2).Value = vTemp
End If
End If
End With
End Sub
It swaps values, not formulae.
Alf
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks