lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
I am trying to cut and paste a range. The code below is giving me out of range error mesage. it opens the second file but wont do the cut. Thank you so much
I am trying to cut and paste a range. The code below is giving me out of range error mesage. it opens the second file but wont do the cut. Thank you so much
Code:
Sub cutcells()
Dim x As String
x = InputBox("enter workbooks name")
Workbooks.Open Filename:=x
Workbooks(1).Worksheets(1).Range("a1:a25").Cut Workbooks(x).Worksheets(1).Range("e1")
Workbooks(x).Save
Workbooks(x).Close
End Sub