Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Linking Tab Names to a single cell with a worksheet

I have tried modifying the VBA code using several of the previous
suggestions but it does not change.

I am trying to link a worksheets "TAB" name to a particular cell in a
pre-existing file.

Question?
Does the sheet need to be named as a default "Sheet1"?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Linking Tab Names to a single cell with a worksheet

P.S. I have tried the following with no success.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("A1")) Is Nothing Then Exit Sub
On Error GoTo CleanUp
Application.EnableEvents = False
With Target
If .Value < "" Then
Me.Name = .Value
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub

Manager wrote:
I have tried modifying the VBA code using several of the previous
suggestions but it does not change.

I am trying to link a worksheets "TAB" name to a particular cell in a
pre-existing file.

Question?
Does the sheet need to be named as a default "Sheet1"?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Linking Tab Names to a single cell with a worksheet

As long as you have already saved the Worksheet with the Tab name you want, I
think this is what your looking for.
Sub MyTab()
If Range("A1") = "" Then
[A1] =
"=MID(CELL(""FILENAME"",A1),FIND(""]"",CELL(""FILENAME"",A1))+1,225)"
End If
End Sub
--
Mike Q.


"Manager" wrote:

P.S. I have tried the following with no success.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("A1")) Is Nothing Then Exit Sub
On Error GoTo CleanUp
Application.EnableEvents = False
With Target
If .Value < "" Then
Me.Name = .Value
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub

Manager wrote:
I have tried modifying the VBA code using several of the previous
suggestions but it does not change.

I am trying to link a worksheets "TAB" name to a particular cell in a
pre-existing file.

Question?
Does the sheet need to be named as a default "Sheet1"?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Linking Tab Names to a single cell with a worksheet

Mike,

Don't mean to be dense but would "Filename" = the actual Excel file
name?
And I'm assuming that I can substitute cell "A!" for any other cell??

Mike Q. wrote:
As long as you have already saved the Worksheet with the Tab name you want, I
think this is what your looking for.
Sub MyTab()
If Range("A1") = "" Then
[A1] =
"=MID(CELL(""FILENAME"",A1),FIND(""]"",CELL(""FILENAME"",A1))+1,225)"
End If
End Sub
--
Mike Q.


"Manager" wrote:

P.S. I have tried the following with no success.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("A1")) Is Nothing Then Exit Sub
On Error GoTo CleanUp
Application.EnableEvents = False
With Target
If .Value < "" Then
Me.Name = .Value
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub

Manager wrote:
I have tried modifying the VBA code using several of the previous
suggestions but it does not change.

I am trying to link a worksheets "TAB" name to a particular cell in a
pre-existing file.

Question?
Does the sheet need to be named as a default "Sheet1"?




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Linking Tab Names to a single cell with a worksheet

FIND(""]"",CELL(""FILENAME"",A1))+1,225)

The above part in the formula will find the " ] " and use it as the
"starting number plus 1" to give give you up to the next 225 characters.
cell("filename",A1) = C:\Quinn\Excel\[MySpreadsheet.xls]Sheet1
] = is the 34th character + 1 =35
so mid(start_num is 35 (S in Sheet1),Num_char is 225)
Of course my tabs only accepts 31 characters not 225. Guess I should fix
that.

--
Mike Q.


"Manager" wrote:

Mike,

Don't mean to be dense but would "Filename" = the actual Excel file
name?
And I'm assuming that I can substitute cell "A!" for any other cell??

Mike Q. wrote:
As long as you have already saved the Worksheet with the Tab name you want, I
think this is what your looking for.
Sub MyTab()
If Range("A1") = "" Then
[A1] =
"=MID(CELL(""FILENAME"",A1),FIND(""]"",CELL(""FILENAME"",A1))+1,225)"
End If
End Sub
--
Mike Q.


"Manager" wrote:

P.S. I have tried the following with no success.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("A1")) Is Nothing Then Exit Sub
On Error GoTo CleanUp
Application.EnableEvents = False
With Target
If .Value < "" Then
Me.Name = .Value
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub

Manager wrote:
I have tried modifying the VBA code using several of the previous
suggestions but it does not change.

I am trying to link a worksheets "TAB" name to a particular cell in a
pre-existing file.

Question?
Does the sheet need to be named as a default "Sheet1"?




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking Tab/worksheet names to a worksheet cell LinLin Excel Discussion (Misc queries) 3 March 9th 09 03:31 PM
Linking a single number or text to a cell betsy Excel Worksheet Functions 3 July 13th 07 12:43 AM
Linking one single cell to a lot number of cells . Sumit Juneja Excel Discussion (Misc queries) 0 September 6th 06 10:04 PM
Linking arrays and Worksheet names gsimmons2005 Excel Worksheet Functions 2 August 18th 05 04:54 PM
create a list of worksheet names (from a single folder, or open files) Drew Excel Discussion (Misc queries) 2 April 15th 05 04:58 PM


All times are GMT +1. The time now is 04:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"