ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   paste-link tab name via vba editor (https://www.excelbanter.com/excel-discussion-misc-queries/172775-paste-link-tab-name-via-vba-editor.html)

i2meek

paste-link tab name via vba editor
 
In Excel 2007 I wish to use the code below that I found and pasted on this
site but I have never used the vba editor. I can get to where the program
goes, but I am not sure what part of the formula needs to be replaced with
the actual workbook, worksheet, cell locations. For instance in my workbook
named "Bk Stats Master_Forms", I have a worksheet named "Schedule". In the
"Schedule" worksheet I have listed team names in column E. I want to link
these team names to the worksheet tabs. For instance I want one worksheet tab
name to be linked from "Schedule" worksheet cell "E6", then the next
worksheet name to be linked from "Schedule" "E7" etc. All in the same
workbook. What parts of the module are replaced with the actual workbook
name, worksheet name, cell, location/destination?
Thanks

I Found this:
"you have to use an event programme inthe vba
open vb editor
click control+R
you get project window
in the particular workbook right click <this workbook and click <view code
copy this in the module"

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
ActiveSheet.Name = Range("a2").Value
End Sub

"whenever in the active sheet A2 is changed that sheet name is also changed."


Don Guillett

paste-link tab name via vba editor
 
Pls do NOT post in multiple groups with multiple subject lines. All you do
is waste time and effort. See other post

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"i2meek" wrote in message
...
In Excel 2007 I wish to use the code below that I found and pasted on this
site but I have never used the vba editor. I can get to where the program
goes, but I am not sure what part of the formula needs to be replaced with
the actual workbook, worksheet, cell locations. For instance in my
workbook
named "Bk Stats Master_Forms", I have a worksheet named "Schedule". In the
"Schedule" worksheet I have listed team names in column E. I want to link
these team names to the worksheet tabs. For instance I want one worksheet
tab
name to be linked from "Schedule" worksheet cell "E6", then the next
worksheet name to be linked from "Schedule" "E7" etc. All in the same
workbook. What parts of the module are replaced with the actual workbook
name, worksheet name, cell, location/destination?
Thanks

I Found this:
"you have to use an event programme inthe vba
open vb editor
click control+R
you get project window
in the particular workbook right click <this workbook and click <view
code
copy this in the module"

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
ActiveSheet.Name = Range("a2").Value
End Sub

"whenever in the active sheet A2 is changed that sheet name is also
changed."




All times are GMT +1. The time now is 12:01 PM.

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