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 December 4th, 2014, 10:41 AM
Registered User
 
Join Date: Dec 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help hyperlink

Hello, I am having a bit of a problem. I am a self taught excel user and learn as I go. I keep spreadsheets for a library that I work at. It is more of a hobby then a work requirement. Anyway I have a bunch of (book)collections that keep track of, roughly about 50 crates of 20 books each.
My question is if I have a spreadsheet with say 51 sheets each except for the first (this first one one would be labeled "schools" labeled "crate 1", "crate 2", "crate 3", and so on. how can I make it so if I have column A1="school name" and column b1=the "crate#" it would make a hyperlink to the sheet named after the crate number in the cell of b1. to make it harder I need it to be based of the text in the cell because it changes every week so the hyperlink needs to update if I move "crate 1" from "school 1" to "school 2" because "school 1" will now have "crate 2" and I need the hyperlink to go to "crate 2" now and not "crate 1".
I hope I explained it ok if not I can try to answer any questions. it would just make my record keeping so much sampler. thank you.
 
Old December 5th, 2014, 03:16 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi

I hope you had your hands dirty with VBA too. The following snippet does a bit of what you want

Code:
For i = 3 To ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row
    ActiveSheet.Hyperlinks.Add Anchor:=ActiveSheet.Cells(i, 2), Address:="", SubAddress:= _
      ActiveSheet.Cells(i, 1).Value & "!A1", TextToDisplay:="Click..."
      Next i
End Sub
Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Hyperlink sryap3 Access VBA 1 November 20th, 2008 04:25 PM
Hyperlink desireemm Reporting Services 1 March 17th, 2008 11:35 PM
hyperlink kritimehrotra Excel VBA 3 July 24th, 2006 08:32 PM
hyperlink pab006 Classic ASP Basics 5 December 17th, 2003 10:33 AM
Hyperlink viktor26 Classic ASP Basics 0 October 19th, 2003 09:48 AM





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