nimmi has attended:
Access Advanced course
Excel VBA Introduction course
Excel VBA Intermediate course
Populating Sheets
Populating sheet name with A1
RE: Populating Sheets
Hi Nimmi,
Thank you for the forum question.
All you need to do is to copy the code below and paste it in a module in the workbook where you want to run the code.
Sub NameSheets()
Dim iSheets As Integer
Dim iCounter As Integer
On Error Resume Next
Sheets(1).Select
iSheets = Sheets.Count
For iCounter = 1 To iSheets
ActiveSheet.Name = Range("a1")
Sheets(iCounter + 1).Select
Next iCounter
End Sub
Good luck with the macro
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector
RE: Populating Sheets
Many thanks Jens - Very helpful. Course was very good and I think you are a good teacher!
RE: Populating Sheets
Thank you Nimmi.
I am happy to be able to help you and that the course was useful.
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector
RE: Populating Sheets
Hi Jens
Really sorry but it isnt working.
I needed it to pick up B3 to go on each tab so change A1 to that. Is that correct?
Thanks, Nimmi
RE: Populating Sheets
Hi Nimmi,
I am sorry it isn't working but it is very easy to fix.
Yes you only have to change A1 to B3 in the line:
ActiveSheet.Name = Range("a1")
I have changed it in the code below.
Sub NameSheets()
Dim iSheets As Integer
Dim iCounter As Integer
On Error Resume Next
Sheets(1).Select
iSheets = Sheets.Count
For iCounter = 1 To iSheets
ActiveSheet.Name = Range("B3")
Sheets(iCounter + 1).Select
Next iCounter
End Sub
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector