I am trying to write VB code to pick selected tabs, reference cell A1 in that tab and rename the tab.
I've literally only started using VB a couple of hours ago but I'm a long time excel user.
I read a couple of threads on this site that were answers to similar questions I was asking but not exactly and here is what I've cobbled together:
Sub Rename_Select_Sheets()
sheetlist = Array(Sheet1, Sheet2, Sheet4)
For i = LBound(sheetlist) To UBound(sheetlist)
Worksheets(sheetlist(i)).Activate
Worksheet.Name = "CPX - " + Range("a1")
Next
End Sub
I've literally only started using VB a couple of hours ago but I'm a long time excel user.
I read a couple of threads on this site that were answers to similar questions I was asking but not exactly and here is what I've cobbled together:
Sub Rename_Select_Sheets()
sheetlist = Array(Sheet1, Sheet2, Sheet4)
For i = LBound(sheetlist) To UBound(sheetlist)
Worksheets(sheetlist(i)).Activate
Worksheet.Name = "CPX - " + Range("a1")
Next
End Sub