ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   cell reference for multiple workbooks (https://www.excelbanter.com/excel-discussion-misc-queries/150518-cell-reference-multiple-workbooks.html)

Libby

cell reference for multiple workbooks
 
Can I reference a cell to get the name of a workbook sheet to be dynamic.
--
Libby

Texas Aggie

cell reference for multiple workbooks
 
This will allow you to input a "title" into A2 and it will change the name of
sheet 2. Each time you change A2 on sheet 1, the name of sheet 2 will change
as well.

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ErrorHandler
If Target.Column = 1 Then
If SheetExists(Target.Value) Then
MsgBox "Invalid Sheet Name", vbCritical, "Sheet Name Error"
Application.EnableEvents = False
Application.Undo
Else
Select Case Target.Row
Case 2
Sheet2.Name = Target.Value
End Select
End If
End If
ErrorHandler:
Application.EnableEvents = True
End Sub
--
Silverbird Designs @ www.silverbirddesigns.com

Fighting Texas Aggie Class of 2009


"Libby" wrote:

Can I reference a cell to get the name of a workbook sheet to be dynamic.
--
Libby



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

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