Thanks, Gary, it worked perfectly.
"GaryDK" wrote:
> Hi Rebecca,
>
> Try this and see if it does what you want to create the links.
>
> I assume that both sheets are in the same workbook, and that there are
> no blank cells in your word list. This macro will stop as soon as it
> encounters an empty cell in the column.
>
> You need to put this code into a module. Press Alt+F11 to open the
> Visual Basic Editor and find your workbook's project. Right-click on it
> and select Insert > Module. Now enter this macro in the module's code
> window (to the right):
>
> Sub CreateLinks()
> ' select the first name cell before running
> Dim sCellAddress As String
> Dim sFormulaPrefix As String
> Dim SLinkFormula As String
>
> sFormulaPrefix = "=Hyperlink(""[" & _
> ActiveWorkbook.FullName & "]" & _
> ActiveSheet.Name & "!"
>
> While Not IsEmpty(ActiveCell.Value)
> sCellAddress = ActiveCell.Address
> SLinkFormula = sFormulaPrefix & _
> sCellAddress & """,""" & _
> CStr(ActiveCell.Value) & """)"
> Worksheets("Links").Activate
> Range(sCellAddress).Formula = SLinkFormula
> Worksheets("NT").Activate
> ActiveCell.Offset(1, 0).Select
> Wend
> End Sub
>
> Return to Excel (Alt+F11), select the first word in the NT sheet, and
> run the macro (Tools > Macro > Macros...).
>
> This should build your hyperlinks using the same words as in the NT
> sheet, and in the corresponding cells. It's not anything fancy or
> general purpose, just a straightforward approach to do what you
> described (as I understood it :-).
>
> I hope that it works for you,
>
> Gary
> [DropContiguousDigitsTwoThruFiveForDirect]
>
>
|