Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default cell changed - worksheet name changes

I want the active worksheet to be renamed if the user changes cell G7.
The name comes from worksheet "List", cell D15 (this part works).

The following code has no effect:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$G$7" Then ActiveSheet.Name =
Worksheets("List").Range("D15").Value
End Sub

What am I doing wrong?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default cell changed - worksheet name changes

Tom, thanks a lot! That was the problem.

How and/or where did I disable events?

"Tom Ogilvy" schrieb:

your original code looks fine and it worked fine for me. "Excelent's" code
is functionally equivalent so I wouldn't expect it to solve your problem (but
who knows).

I would suggest that you have events disabled.

Try running this macro

Sub TurnOnEvents()
Application.EnableEvents = True
End Sub

--
Regards,
Tom Ogilvy



"claudio" wrote:

I want the active worksheet to be renamed if the user changes cell G7.
The name comes from worksheet "List", cell D15 (this part works).

The following code has no effect:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$G$7" Then ActiveSheet.Name =
Worksheets("List").Range("D15").Value
End Sub

What am I doing wrong?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default cell changed - worksheet name changes

your original code looks fine and it worked fine for me. "Excelent's" code
is functionally equivalent so I wouldn't expect it to solve your problem (but
who knows).

I would suggest that you have events disabled.

Try running this macro

Sub TurnOnEvents()
Application.EnableEvents = True
End Sub

--
Regards,
Tom Ogilvy



"claudio" wrote:

I want the active worksheet to be renamed if the user changes cell G7.
The name comes from worksheet "List", cell D15 (this part works).

The following code has no effect:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$G$7" Then ActiveSheet.Name =
Worksheets("List").Range("D15").Value
End Sub

What am I doing wrong?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default cell changed - worksheet name changes

Unless it was a fluk, somewhere you might have the command

application.enableevents = False

perhaps it is from a 3rd party addin that errored out before it reenabled
them.

--
regards,
Tom Ogilvy



"claudio" wrote:

Tom, thanks a lot! That was the problem.

How and/or where did I disable events?

"Tom Ogilvy" schrieb:

your original code looks fine and it worked fine for me. "Excelent's" code
is functionally equivalent so I wouldn't expect it to solve your problem (but
who knows).

I would suggest that you have events disabled.

Try running this macro

Sub TurnOnEvents()
Application.EnableEvents = True
End Sub

--
Regards,
Tom Ogilvy



"claudio" wrote:

I want the active worksheet to be renamed if the user changes cell G7.
The name comes from worksheet "List", cell D15 (this part works).

The following code has no effect:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$G$7" Then ActiveSheet.Name =
Worksheets("List").Range("D15").Value
End Sub

What am I doing wrong?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update date & time in a cell only when worksheet is changed RJD Excel Discussion (Misc queries) 6 December 23rd 09 03:57 PM
Macro in worksheet with changed name Claireybelle90 Excel Discussion (Misc queries) 1 June 16th 09 05:00 PM
Format changed when the details in cell changed angel Excel Worksheet Functions 9 July 15th 08 12:36 AM
cell changed - worksheet name changes excelent Excel Programming 0 August 17th 06 07:25 PM
Sound+color alert if cell changed in another worksheet florinel Excel Discussion (Misc queries) 0 May 25th 06 04:52 PM


All times are GMT +1. The time now is 02:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"