I have excell vba code. this works 100% but works to good as it copies the whole worksheet and not just the cells wit data in. there will be around 3000 rows. so how can i limit the copy to 5000 rows and to column bz?
Private Sub CommandButton1_Click()
Application.CopyObjectsWithCells = False
Dim newBook As Excel.Workbook
Dim rng As Excel.Range
Set newBook = Workbooks.Add
Set rng = ThisWorkbook.Worksheets("Accounts Full").Cells.SpecialCells(xlCellTypeVisible)
rng.Copy newBook.Worksheets("Sheet1").Range("A1")
Application.CopyObjectsWithCells = True 'reset
End Sub