ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   cell changed - worksheet name changes (https://www.excelbanter.com/excel-programming/370711-re-cell-changed-worksheet-name-changes.html)

excelent

cell changed - worksheet name changes
 
try

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Intersect(Target, Range("G7")) Is Nothing Then Exit Sub
ActiveSheet.Name = Worksheets("List").Range("D15").Value
End Sub







"claudio" skrev:

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?



All times are GMT +1. The time now is 12:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com