Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 10th, 2007, 09:43 AM
Authorized User
 
Join Date: Jan 2007
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default LookUp and Hyperlink

In an Excel woorkbook, i have 2 sheets.
One "User Interface" sheet with a drop-down cell where the user makes his choice and a hidden sheet with a data table

i use the VLOOKUP function to acquire info from the table, which is "pasted" into the "user interface" sheet.
The table has a column with a list of hyperlinks(in this case reports in pdf.files).

In the "user interface" sheet i have pasted a PDF logo/picture. What i want to have is a makro attached to this logo, which open the specific hyperlink (report).

Perhaps this will help you to understand what i mean, although the VBA code does not work:

Sub Hyper()

    Application.ScreenUpdating = False
    Worksheets("Hidden sheet").Select
    Range("=HYPERLINK(VLOOKUP('Hidden sheet'!L50;'Hidden sheet'! K7:K49;'Hidden sheet'!Z7:Z49))").Select
    Selection.Hyperlinks(1).Follow NewWindow:=True, AddHistory:=False
    Worksheets("User interface sheet").Activate
End Sub

This code works:

Sub Hyper()

    Application.ScreenUpdating = False
    Worksheets("Hidden sheet").Select
    Range("Z4")Select
    Selection.Hyperlinks(1).Follow NewWindow:=True, AddHistory:=False
    Worksheets("User interface sheet").Activate
End Sub

and this:

=HYPERLINK(VLOOKUP('Hidden sheet'!L50;'Hidden sheet'! K7:K49;'Hidden sheet'!Z7:Z49))

BUT NOT TOGETHER.

What can i do?
 
Old January 12th, 2007, 03:03 AM
Authorized User
 
Join Date: Jan 2007
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This solved my problem:

Attached VBA module on PDF log in "user interfase" woorksheet

Sub hyper()
    Application.ScreenUpdating = False
    Worksheets("hidden sheet").Select
    ActiveWorkbook.FollowHyperlink Address:="File:///f:\" & Range("l52"), _
    NewWindow:=True, AddHistory:=False
    Worksheets("user interfase").Activate
End Sub

content in cell l52 in worksheet "hidden sheet": =HYPERLINK(VLOOKUP('hidden sheet'!L52;'hidden sheet'!K7:K49;'hidden sheet'!Z7:Z49))








Similar Threads
Thread Thread Starter Forum Replies Last Post
lookup value in table Vince_421 Access 16 February 13th, 2007 08:15 AM
lookup using VB karebear VB How-To 1 August 2nd, 2006 04:32 PM
lookup function Vince_421 Access VBA 14 May 19th, 2006 07:27 AM
Lookup Tables mossimo Access 4 December 5th, 2003 11:27 AM
File name lookup acdsky Classic ASP Basics 3 November 22nd, 2003 11:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.