Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Creating a hyperlink | New Users to Excel | |||
Creating a HyperLink | Excel Discussion (Misc queries) | |||
Need help creating a variable size printarea marco. | Excel Programming | |||
Marco & hyperlink | Excel Programming | |||
Help with creating hyperlink via VBA | Excel Programming |