ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   AutoUpdate (https://www.excelbanter.com/excel-discussion-misc-queries/154395-re-autoupdate.html)

joel

AutoUpdate
 
You can do it with a worksheet change function. Put the code into the VBA
worksheet you want it to run on (not a module VBA module). A worksheet
change only works on one worksheet. You must copy it to each worksheet where
you want it to run.

Sub worksheet_change(ByVal target As Range)
If target.Address = "$M$2" Then
ActiveSheet.Name = target.Value
End If
End Sub


"Danny" wrote:

Hi There,

Who can help me with the following,

I have below formula to let the Sheet name be updated after filling in a
Cell (reference), this is working when i run this macro manually.

Sub Rename_Sheet()

ActiveSheet.Name = ActiveSheet.Range("M2")
End Sub

I'm now looking for a way to have the name of the sheet be updated
automatically the moment i fill in the Cell?

Is there anyone who can help me with this?

Thanks
Danny



All times are GMT +1. The time now is 10:39 AM.

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