dpaton05
Well-known Member
- Joined
- Aug 14, 2018
- Messages
- 2,375
- Office Version
- 365
- 2016
- Platform
- Windows
I have a sheet that has I13 to contain a month and year for instance July 2018 and sheet names for instance July 2018 and i AM trying to copy the first 4 columns of July 2018 and paste them into a new workbook. What is wrong with this code?
Private Sub cmdCopySheet_Click()
Dim CopyMonth As String
CopyMonth = Range("I13").Value
Worksheets(CopyMonth).Select
Columns("A:D").copy
Workbooks.Add
ActiveSheet.Paste
End Sub
Private Sub cmdCopySheet_Click()
Dim CopyMonth As String
CopyMonth = Range("I13").Value
Worksheets(CopyMonth).Select
Columns("A:D").copy
Workbooks.Add
ActiveSheet.Paste
End Sub