PC Review


Reply
Thread Tools Rate Thread

Automation Macro for updating formula when changing cell value

 
 
=?Utf-8?B?RGFubnk=?=
Guest
Posts: n/a
 
      17th Aug 2007
I have the following macro:
Sub Rename_Sheet()

ActiveSheet.Name = ActiveSheet.Range("M2")
End Sub
This macro will change the name of the sheet into what has been filled in
the cell reference.
Does anyone know how this can be done / run automatic when the Cell is
changed / filled in?

Thanks
 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      17th Aug 2007
Hi,

Try this
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$M$2" Then
If Target.Value <> "" Then
ActiveSheet.Name = Target.Value
End If
End If
End Sub


Right click the sheet tab, view code and paste this in

Mike


"Danny" wrote:

> I have the following macro:
> Sub Rename_Sheet()
>
> ActiveSheet.Name = ActiveSheet.Range("M2")
> End Sub
> This macro will change the name of the sheet into what has been filled in
> the cell reference.
> Does anyone know how this can be done / run automatic when the Cell is
> changed / filled in?
>
> Thanks

 
Reply With Quote
 
=?Utf-8?B?RGFubnk=?=
Guest
Posts: n/a
 
      17th Aug 2007
Hi Mike,

Maybe you can help me with 2 other issues?

1> I have an protection build in through VB, because of the grouping option:
Private Sub Workbook_Open()

With Worksheets("Myself")
.EnableOutlining = True
.Protect Password:="DAF", Contents:=True, UserInterfaceOnly:=True
End With
End Sub

This protection is looking at the sheet "Myself" / relating to the reference
in my earlier issue. What would be the possibility to have this macro working
for all Sheets without referring to a name (because the name can change)?

2> The sheet have to be filled in per individu (some sort of appraisal) if i
want to have the outcome in a sort of summery (data base) for all the people
i can use formulas reffering to the sheets, but sheets will be added,
removed and changed, do you know a macro who automatically will update the
data base / summery when a sheet is filled in?

Thanks

"Danny" wrote:

> I have the following macro:
> Sub Rename_Sheet()
>
> ActiveSheet.Name = ActiveSheet.Range("M2")
> End Sub
> This macro will change the name of the sheet into what has been filled in
> the cell reference.
> Does anyone know how this can be done / run automatic when the Cell is
> changed / filled in?
>
> Thanks

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run macro when when changing cell value with formula. Kollijonke Microsoft Excel Programming 2 5th Aug 2009 03:53 PM
RE: Automation Macro for updating formula when changing cell value =?Utf-8?B?RGFubnk=?= Microsoft Excel Misc 0 17th Aug 2007 01:47 AM
get the value of a formula in cell B1 into cell A1 without changing my current cell selection News Microsoft Excel Programming 3 21st Oct 2006 12:24 AM
changing cell formula part of macro thephoenix12 Microsoft Excel Programming 1 12th Aug 2005 10:00 PM
Macro Formula Updating Problem =?Utf-8?B?VGlt?= Microsoft Excel Programming 0 8th Jun 2004 05:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:45 PM.