Hi all
I have a workbook that i have developed that reports the number of document reviews due - either over due or future due..
A) within the workbook i have a macro (borrowed from the web) that creates a new worksheet for each business unit and the current reporting month (From a set range). works perfectly see below
Sub CreateSheetsformonth()
Dim MyCell As Range, MyRange As Range
Set MyRange = Sheets("Formatting").Range("i2:i19")
For Each MyCell In MyRange
Sheets.Add After:=Sheets(Sheets.Count) 'creates a new worksheet
Sheets(Sheets.Count).Name = MyCell.Value ' renames the new worksheet
Next MyCell
End Sub
B) I then have a macro that goes to a master sheet and copies the values related to 'Unit 1" for example....worksheet is titled 'ARP To 31 March 2017' for example
my issue is that while my A) is updated within the range on a monthly basis, how can i auto update the worksheet name B) within the macro
hard to explain sorry the below code is where i need to be able to auto update the worksheet name
Sub Month_Updates_ARP()
'
' Month_Updates Macro
'
'
Sheets("Quarter").Select
Range("A1:e1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$e$500").AutoFilter Field:=4, Criteria1:="ARP"
Range("$A$1:$e$500").Select
Selection.Copy
Sheets("ARP To 31 March 2017").Select
Range("A1").Select
ActiveSheet.Paste
Columns("A:E").Select
Selection.ColumnWidth = 52.73
Application.CutCopyMode = False
Sheets("Formatting").Select
End Sub
there is a total of 50 worksheets created and need updating and i don't want to have to manually do thiws within code...
any ideas appreciated
rgds Shaz
I have a workbook that i have developed that reports the number of document reviews due - either over due or future due..
A) within the workbook i have a macro (borrowed from the web) that creates a new worksheet for each business unit and the current reporting month (From a set range). works perfectly see below
Sub CreateSheetsformonth()
Dim MyCell As Range, MyRange As Range
Set MyRange = Sheets("Formatting").Range("i2:i19")
For Each MyCell In MyRange
Sheets.Add After:=Sheets(Sheets.Count) 'creates a new worksheet
Sheets(Sheets.Count).Name = MyCell.Value ' renames the new worksheet
Next MyCell
End Sub
B) I then have a macro that goes to a master sheet and copies the values related to 'Unit 1" for example....worksheet is titled 'ARP To 31 March 2017' for example
my issue is that while my A) is updated within the range on a monthly basis, how can i auto update the worksheet name B) within the macro
hard to explain sorry the below code is where i need to be able to auto update the worksheet name
Sub Month_Updates_ARP()
'
' Month_Updates Macro
'
'
Sheets("Quarter").Select
Range("A1:e1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$e$500").AutoFilter Field:=4, Criteria1:="ARP"
Range("$A$1:$e$500").Select
Selection.Copy
Sheets("ARP To 31 March 2017").Select
Range("A1").Select
ActiveSheet.Paste
Columns("A:E").Select
Selection.ColumnWidth = 52.73
Application.CutCopyMode = False
Sheets("Formatting").Select
End Sub
there is a total of 50 worksheets created and need updating and i don't want to have to manually do thiws within code...
any ideas appreciated
rgds Shaz