Naming Worksheets

Discussion regarding the spreadsheet functionality of Bet Angel.
Post Reply
User avatar
LeTiss
Posts: 5485
Joined: Fri May 08, 2009 6:04 pm

I'm doing some work with Excel, but am having trouble with one aspect

I'm trying to set up a macro that changes every sheet's name in the workbook to the value in cell A2 of the corresponding sheet

If any Excel experts know the answer, I'd be much obliged for guidance

Cheers
LT
toptrader
Posts: 77
Joined: Sun Jan 31, 2010 9:58 pm

Hi LeTiss

try Application.ActiveSheet.Name=Range("A2")
User avatar
LeTiss
Posts: 5485
Joined: Fri May 08, 2009 6:04 pm

Thanks for the response TT

Could you elaborate?

I've almost given up now
nigelk
Posts: 469
Joined: Wed Apr 15, 2009 11:00 pm

Hi LT,

if you know how to insert a module, try this one.
(Put it at the beginning of your subroutine)

Dim WS As Worksheet

For Each WS In Application.Worksheets
WS.Activate
WS.Name = Range("A2")
Next WS

If still not sure, let me know.

Nigel.
User avatar
LeTiss
Posts: 5485
Joined: Fri May 08, 2009 6:04 pm

All sorted, cheers fellas
Post Reply

Return to “Bet Angel - Spreadsheet / Excel chat”