![]() |
Creating Macro to insert a hyperlink and then sort ...
Hi all
I have created the macro below which copies a template worksheet, pastes it into the current workbook and then creates a hyperlink in a specified cell. Sub Macro3() ' ' Macro3 Macro ' Macro recorded 04/04/2007 by michaelc ' ' Keyboard Shortcut: Ctrl+z ' Sheets("Template").Select Sheets("Template").Copy After:=Sheets(47) ActiveWindow.ScrollWorkbookTabs Position:=xlFirst Sheets("Index").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _ "'Template (2)'!A1", TextToDisplay:="'Template (2)'!A1" End Sub However, what I would really like it to do is insert a new hyperlink for each sheet when the macro is used again, in the cell below the previous hyperlink. Also, I'm sure this must be possible - I would then like to sort the hyperlinks in alphabetical order once the new sheet / hyperlink has been created. The reason this is not straight forward is that the existing hyperlinks are evenly distributed across 3 columns instead of one (this main sheet just acts as an index sheet). If I try to sort the columns by highlighting all three columns in the usual way it will just sort each column alphabetically - does that make sense?!?! Thanks for any help - very much appreciated! Mike |
All times are GMT +1. The time now is 01:17 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com