View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Prompt to enter a macro name?

You do not "run" that code.

It is sheet event code which runs when you change the value of E4

Make sure the code is stored in the sheet module.

Right-click on sheet tab and "View Code"

Copy/paste into that module.

Alt + q to return to Excel.

Enter a word in E4

Your sheet name will change to that word.


Gord Dibben MS Excel MVP

On Thu, 17 Dec 2009 08:51:55 -0800 (PST), andreashermle
wrote:

Dear Experts:

Whenever I run this macro a dialog field pops up asking me to enter a
macro name. Why is this so?


Sub Worksheet_Change(ByVal Target As Excel.Range)

If Len(Range("E4")) < 32 And Range("E4") < "" Then
ActiveSheet.Name = Range("E4").Value
End If

End Sub