Hi team,
I have a workbook that opens another workbook, copies the cells I require, and pastes them into a new worksheet.
This is the code I have already:
Once this has macro has been executed, I manually rename the worksheet to say "Week 10" for example. The previous sheet names are "Week 1", "Week 2", "Week 3", etc...
Could you please help me to amend my code so it renames the tab by an increment of 1?
And could also help me to close the worksheet where I copied the data from and not save any changes to it?
Any help would be greatly appreciated.
Thanks team.
Cheers
Brad.
I have a workbook that opens another workbook, copies the cells I require, and pastes them into a new worksheet.
This is the code I have already:
Code:
Sub AddSheet()
Application.GetOpenFilename
Cells.Select
Selection.Copy
ThisWorkbook.Activate
Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Week"
Cells.Select
ActiveSheet.Paste
Range("A1:I1").Select
ActiveWindow.DisplayGridlines = False
End Sub
Once this has macro has been executed, I manually rename the worksheet to say "Week 10" for example. The previous sheet names are "Week 1", "Week 2", "Week 3", etc...
Could you please help me to amend my code so it renames the tab by an increment of 1?
And could also help me to close the worksheet where I copied the data from and not save any changes to it?
Any help would be greatly appreciated.
Thanks team.
Cheers
Brad.