PC Review


Reply
Thread Tools Rate Thread

Creating a Hyperlink within a marco

 
 
MWhaley
Guest
Posts: n/a
 
      13th Apr 2008
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 Before:=Sheets(1)
Sheets.Add
ActiveSheet.Name = Name
Cells(2, 1) = Name

Next i
End Sub

 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      14th Apr 2008
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 Before:=Sheets(1)
> Sheets.Add
> ActiveSheet.Name = Name
> Cells(2, 1) = Name
>
> Next i
> End Sub
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
help creating a marco please lsy Microsoft Excel Programming 3 13th Sep 2008 08:47 PM
Marco/Hyperlink Marco/Hyperlink Function Microsoft Word Document Management 13 11th Jul 2008 05:51 AM
Need help creating a variable size printarea marco. =?Utf-8?B?RS5Tb3J0bGFuZA==?= Microsoft Excel Programming 5 12th Mar 2007 01:18 PM
Hyperlink or Marco for Generating an Email from a form =?Utf-8?B?S2ltLmluLkRlbnZlcg==?= Microsoft Access Macros 4 23rd Jun 2006 09:07 PM
Marco & hyperlink =?Utf-8?B?Z2VyYXJkIEQ=?= Microsoft Excel Programming 1 23rd Feb 2006 07:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:54 PM.