Chewyhairball
Active Member
- Joined
- Nov 30, 2017
- Messages
- 312
- Office Version
- 365
- Platform
- Windows
Hi Folks
I have the following bit of code that lets you select a cell from an input box then select a destination cell from another input box. When you click OK it then cuts the selected cell and pastes it to the selected destination.
What i would actually like it to do is to take the selected cells from the first input box and cut the entire row(or rows) and inset these rows (shift down) to the destination cell row.
eg. In the first input box i might select D20:D23 and the second I might select D30. When i click OK i want the entire rows for 20 to 23 cut and inserted(shift down) to row 30.
thanks in advance for any help with this.
Rory
I have the following bit of code that lets you select a cell from an input box then select a destination cell from another input box. When you click OK it then cuts the selected cell and pastes it to the selected destination.
VBA Code:
Sub movedata()
Dim FromRange As Range
Dim ToRange As Range
Set FromRange = Application.InputBox("Enter the range from which you want to copy : ", Type:=8)
Set ToRange = Application.InputBox("Enter the range to where you want to copy : ", Type:=8)
FromRange.Cut ToRange
End Sub
What i would actually like it to do is to take the selected cells from the first input box and cut the entire row(or rows) and inset these rows (shift down) to the destination cell row.
eg. In the first input box i might select D20:D23 and the second I might select D30. When i click OK i want the entire rows for 20 to 23 cut and inserted(shift down) to row 30.
thanks in advance for any help with this.
Rory