Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Creating a Hyperlink within a marco

I have a worksheet with over 500 names in a column. I wrote a macro that will
create each name as it's own worksheet(tab). I'm wanting in also put in the
macro the ability to hyperlink each on of the names on the first(master)
spreadsheet to it's own worksheet within the workbook. Here is the macro as
I've got it now.

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 4/1/2008 by michael.whaley
'

'
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
' Selection.End(xlDown).Select
'
Dim Name As String =20
For i = 8 To lastrow
Sheets("1st shift").Select
Name = Cells(i, 1)
Sheets("Sheet2").Select
Sheets("Sheet2").Copy Befo=Sheets(1)
Sheets.Add
ActiveSheet.Name = Name
Cells(2, 1) = Name

Next i
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Creating a Hyperlink within a marco

You can do this manually or have the macro paste formulas in column B, but in
B1 enter:

=HYPERLINK("#" &A1 & "!A1") and copy down

Assuming the sheetname is in A1
--
Gary''s Student - gsnu200779


"MWhaley" wrote:

I have a worksheet with over 500 names in a column. I wrote a macro that will
create each name as it's own worksheet(tab). I'm wanting in also put in the
macro the ability to hyperlink each on of the names on the first(master)
spreadsheet to it's own worksheet within the workbook. Here is the macro as
I've got it now.

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 4/1/2008 by michael.whaley
'

'
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
' Selection.End(xlDown).Select
'
Dim Name As String =20
For i = 8 To lastrow
Sheets("1st shift").Select
Name = Cells(i, 1)
Sheets("Sheet2").Select
Sheets("Sheet2").Copy Befo=Sheets(1)
Sheets.Add
ActiveSheet.Name = Name
Cells(2, 1) = Name

Next i
End Sub

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
Creating a hyperlink Louise New Users to Excel 3 November 4th 09 12:22 AM
Creating a HyperLink Robin Clay Excel Discussion (Misc queries) 1 July 7th 08 12:28 PM
Need help creating a variable size printarea marco. E.Sortland Excel Programming 5 March 12th 07 01:18 PM
Marco & hyperlink gerard D Excel Programming 1 February 23rd 06 07:58 PM
Help with creating hyperlink via VBA FrigidDigit[_2_] Excel Programming 8 October 19th 05 06:14 PM


All times are GMT +1. The time now is 08:22 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"