Chewyhairball
Active Member
- Joined
- Nov 30, 2017
- Messages
- 312
- Office Version
- 365
- Platform
- Windows
Hi
The following code when run moves the current selected cell and the 5 cells to the right to whatever destination cell is selected in the Inputbox.
It works good but I cannot figure out how to also move any comments that might be in a cell. Specifically the 5th offset cell.
I have wasted the best part of a day trying all sorts but nothing works
As usual any help is greatly appreciated
The following code when run moves the current selected cell and the 5 cells to the right to whatever destination cell is selected in the Inputbox.
It works good but I cannot figure out how to also move any comments that might be in a cell. Specifically the 5th offset cell.
I have wasted the best part of a day trying all sorts but nothing works
As usual any help is greatly appreciated
VBA Code:
Sub MoveCells()
Dim fromrange As Range
Dim torange As Range
Set torange = Application.InputBox(Title:="Select Destination", prompt:="Select where you want to item/s to be moved to then click OK", Type:=8)
Set fromrange = Range(ActiveCell, ActiveCell.Offset(0, 5))
Range(torange, torange.Offset(0, 5)).Value = fromrange.Value
fromrange.ClearContents
End Sub