aleszib
06-10-2018, 10:07 AM
Dear All,
Can someone help me:
1. How do I have to change my code that it will copy data from active worksheet to new workbook, which I would like to name with value inserted into input box?
Sub copyTableIntoNewWorkbook_Sheet1()
' locate the dynamic range / table
Dim rngTable As Range
With ActiveSheet.[b2] ' top left cell of the dynamic range
Set rngTable = .Resize(Range(.Offset(0), .End(xlDown)).Rows.Count, _
Range(.Offset(0), .End(xlToRight)).Columns.Count)
End With
' create new worksheet
Dim wbNew As Workbook
Set wbNew = Workbooks.Add
' copy table to new worksheet
rngTable.Copy wbNew.Sheets(1).[a1] ' top left cell where to copy the table to
End Sub
2. How do I have to change my code that I can copy more sheets from active workbook to another workbook?
Thank you in advance!
Can someone help me:
1. How do I have to change my code that it will copy data from active worksheet to new workbook, which I would like to name with value inserted into input box?
Sub copyTableIntoNewWorkbook_Sheet1()
' locate the dynamic range / table
Dim rngTable As Range
With ActiveSheet.[b2] ' top left cell of the dynamic range
Set rngTable = .Resize(Range(.Offset(0), .End(xlDown)).Rows.Count, _
Range(.Offset(0), .End(xlToRight)).Columns.Count)
End With
' create new worksheet
Dim wbNew As Workbook
Set wbNew = Workbooks.Add
' copy table to new worksheet
rngTable.Copy wbNew.Sheets(1).[a1] ' top left cell where to copy the table to
End Sub
2. How do I have to change my code that I can copy more sheets from active workbook to another workbook?
Thank you in advance!