C
chris
I am using the following code to link the name of a worksheet to a cell:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim ws2 As Worksheet
Dim cell As Range
If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
On Error Resume Next
Set ws2 = Sheets("Current")
Set cell = Sheets("Totals").Range("A1")
ws2.Name = cell.Text
End Sub
----------
This works great great for cell A1 but I can't get it to use any other cell.
If I change it to A2 or B1 it doesn't work. What I would like to be able to
do is use the last used cell in column A. Also is it possible for this to
not take effect until I push a button or something. In other words, I want
sheet "Current" to be called "Current" until I run a macro. Currently, I
have the code attached to the "Totals" sheet.
Any help would be greatly appreciated.
Chris
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim ws2 As Worksheet
Dim cell As Range
If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
On Error Resume Next
Set ws2 = Sheets("Current")
Set cell = Sheets("Totals").Range("A1")
ws2.Name = cell.Text
End Sub
----------
This works great great for cell A1 but I can't get it to use any other cell.
If I change it to A2 or B1 it doesn't work. What I would like to be able to
do is use the last used cell in column A. Also is it possible for this to
not take effect until I push a button or something. In other words, I want
sheet "Current" to be called "Current" until I run a macro. Currently, I
have the code attached to the "Totals" sheet.
Any help would be greatly appreciated.
Chris