Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Resetting Hyperlink to Worksheet

I have a program that renames the names in Column A and its associated
worksheet.
All the names in Column A are hyperlinked to its associated worksheet. The
names in Column A and the worksheet name are the same.
When I make the name changes, the hyperlink is broken.
I just need to set the hyperlink in the cell that was changed in Column A to
it's associated worksheet again.

Here is the code I use to make the changes. Thanks!

RowNum = Application.InputBox(prompt:="What is the Row Number of the
Location You Want to Change?", Type:=2)
FranNum = Application.InputBox(prompt:="What is the Franchise Number You
Want to Use?", Type:=2)
LabelName = Application.InputBox(prompt:="What is the Franchise Name You
Want To Use?", Type:=2)

If RowNum = "0" Then
'do nothing
Else

Cells((RowNum), 1).Select
OldLabelName = Cells((RowNum), 1).Value

Cells((RowNum), 2).Select

ActiveCell.FormulaR1C1 = (FranNum)
Cells((RowNum), 1).Select
ActiveCell.FormulaR1C1 = (LabelName)
Cells((RowNum), 1).Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Sheets(OldLabelName).Select
Sheets(OldLabelName).Name = (LabelName)

NEED CODE HERE TO RESET THE HYPERLINK TO THE SHEET ONLY - NOT TO A CELL ON
THE SHEET.

David


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Resetting Hyperlink to Worksheet

Perhaps using a separate column for the active "clickable" links. If you are
updating a link in column A and the result does not "click", then in another
column enter:

=HYPERLINK(A1)

This should always give a "clickable" result.
--
Gary''s Student - gsnu200721


"David" wrote:

I have a program that renames the names in Column A and its associated
worksheet.
All the names in Column A are hyperlinked to its associated worksheet. The
names in Column A and the worksheet name are the same.
When I make the name changes, the hyperlink is broken.
I just need to set the hyperlink in the cell that was changed in Column A to
it's associated worksheet again.

Here is the code I use to make the changes. Thanks!

RowNum = Application.InputBox(prompt:="What is the Row Number of the
Location You Want to Change?", Type:=2)
FranNum = Application.InputBox(prompt:="What is the Franchise Number You
Want to Use?", Type:=2)
LabelName = Application.InputBox(prompt:="What is the Franchise Name You
Want To Use?", Type:=2)

If RowNum = "0" Then
'do nothing
Else

Cells((RowNum), 1).Select
OldLabelName = Cells((RowNum), 1).Value

Cells((RowNum), 2).Select

ActiveCell.FormulaR1C1 = (FranNum)
Cells((RowNum), 1).Select
ActiveCell.FormulaR1C1 = (LabelName)
Cells((RowNum), 1).Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Sheets(OldLabelName).Select
Sheets(OldLabelName).Name = (LabelName)

NEED CODE HERE TO RESET THE HYPERLINK TO THE SHEET ONLY - NOT TO A CELL ON
THE SHEET.

David


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Resetting Hyperlink to Worksheet

The worksheet is fixed and used by multiple people in the office.
The way the program works, people need to change the number in Column B, the
Location Name in Column A, and have the Location Name in Column A be a
hyperlink to a worksheet that will be named the same as the Location Name in
Column A.
Once the worksheet name is changed, the hyperlink is broken. I need to reset
the hyperlink to the new worksheet name.
Thanks!

David

"Gary''s Student" wrote:

Perhaps using a separate column for the active "clickable" links. If you are
updating a link in column A and the result does not "click", then in another
column enter:

=HYPERLINK(A1)

This should always give a "clickable" result.
--
Gary''s Student - gsnu200721


"David" wrote:

I have a program that renames the names in Column A and its associated
worksheet.
All the names in Column A are hyperlinked to its associated worksheet. The
names in Column A and the worksheet name are the same.
When I make the name changes, the hyperlink is broken.
I just need to set the hyperlink in the cell that was changed in Column A to
it's associated worksheet again.

Here is the code I use to make the changes. Thanks!

RowNum = Application.InputBox(prompt:="What is the Row Number of the
Location You Want to Change?", Type:=2)
FranNum = Application.InputBox(prompt:="What is the Franchise Number You
Want to Use?", Type:=2)
LabelName = Application.InputBox(prompt:="What is the Franchise Name You
Want To Use?", Type:=2)

If RowNum = "0" Then
'do nothing
Else

Cells((RowNum), 1).Select
OldLabelName = Cells((RowNum), 1).Value

Cells((RowNum), 2).Select

ActiveCell.FormulaR1C1 = (FranNum)
Cells((RowNum), 1).Select
ActiveCell.FormulaR1C1 = (LabelName)
Cells((RowNum), 1).Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Sheets(OldLabelName).Select
Sheets(OldLabelName).Name = (LabelName)

NEED CODE HERE TO RESET THE HYPERLINK TO THE SHEET ONLY - NOT TO A CELL ON
THE SHEET.

David


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Resetting Hyperlink to Worksheet

Hyperlinks to a different sheet in the same workbook can be implemented by
either:
Insert Hyperlink
or the HYPERLINK () function.


The advantage to using the function is that if you have many hyperlinks of
the form:
=HYPERLINK("#Sheet3!A1","table of contents")
where they all refer to Sheet3 then the better form is:
=HYPERLINK("#" & A1 & "!Z100","table of contents")
Where you put Sheet3 in cell A1. All these hyperlinks will refer to cell A1
for the sheetname.


You only have to change one cell to "un-break" all the links.
--
Gary''s Student - gsnu200721


"David" wrote:

The worksheet is fixed and used by multiple people in the office.
The way the program works, people need to change the number in Column B, the
Location Name in Column A, and have the Location Name in Column A be a
hyperlink to a worksheet that will be named the same as the Location Name in
Column A.
Once the worksheet name is changed, the hyperlink is broken. I need to reset
the hyperlink to the new worksheet name.
Thanks!

David

"Gary''s Student" wrote:

Perhaps using a separate column for the active "clickable" links. If you are
updating a link in column A and the result does not "click", then in another
column enter:

=HYPERLINK(A1)

This should always give a "clickable" result.
--
Gary''s Student - gsnu200721


"David" wrote:

I have a program that renames the names in Column A and its associated
worksheet.
All the names in Column A are hyperlinked to its associated worksheet. The
names in Column A and the worksheet name are the same.
When I make the name changes, the hyperlink is broken.
I just need to set the hyperlink in the cell that was changed in Column A to
it's associated worksheet again.

Here is the code I use to make the changes. Thanks!

RowNum = Application.InputBox(prompt:="What is the Row Number of the
Location You Want to Change?", Type:=2)
FranNum = Application.InputBox(prompt:="What is the Franchise Number You
Want to Use?", Type:=2)
LabelName = Application.InputBox(prompt:="What is the Franchise Name You
Want To Use?", Type:=2)

If RowNum = "0" Then
'do nothing
Else

Cells((RowNum), 1).Select
OldLabelName = Cells((RowNum), 1).Value

Cells((RowNum), 2).Select

ActiveCell.FormulaR1C1 = (FranNum)
Cells((RowNum), 1).Select
ActiveCell.FormulaR1C1 = (LabelName)
Cells((RowNum), 1).Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Sheets(OldLabelName).Select
Sheets(OldLabelName).Name = (LabelName)

NEED CODE HERE TO RESET THE HYPERLINK TO THE SHEET ONLY - NOT TO A CELL ON
THE SHEET.

David


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
Chart worksheet names keep resetting dloomer Charts and Charting in Excel 0 December 10th 09 05:58 PM
Hyperlink - particular worksheet Mike Excel Discussion (Misc queries) 0 May 11th 09 09:28 PM
Troubleshoot resetting hyperlink base to a network drive Diane Excel Worksheet Functions 1 August 12th 05 05:38 PM
Resetting the end of a worksheet Cachod1 New Users to Excel 1 March 29th 05 07:44 PM
resetting worksheet properties Michael J. Malinsky Excel Programming 1 July 15th 03 05:23 PM


All times are GMT +1. The time now is 10:02 AM.

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"