View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Using VB to change sheet name to match cell contents

Hi
try
sub foo()
with activesheet
.name=.range("A1").value
end with
end sub

--
Regards
Frank Kabel
Frankfurt, Germany


Gary Paxson wrote:
Is there an easy way using VB to change the currently
active sheet's name to a cell value?

Scenario:
---------
I have a time reporting sheet which uses an employee
name validation pulldown to select and show work time
statistics for any of my staff.

I'd like to create a complimentary VB function which
changes the sheet's name to match that of the currently
selected employee, preferably via a changed cell action,
but I'd settle for creating a button control to accomplish
the sheet name change.

Any suggestions or code examples would be appreciated

Thx - GP