Actuarial Outpost
 
Go Back   Actuarial Outpost > Actuarial Discussion Forum > Software & Technology
FlashChat Actuarial Discussion Preliminary Exams CAS/SOA Exams Cyberchat Around the World Suggestions


Fill in a brief DW Simpson Registration Form
to be contacted when new jobs meet your criteria.


Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-17-2019, 08:56 AM
mch375 mch375 is offline
CAS SOA
 
Join Date: Mar 2019
College: Postgraduate
Posts: 16
Default How to change the name of hyperlink to the column header of the arriving cell (VBA)

Sorry for a wordy title. I have wrote code below creating a hyperlink on the x's under # column, and when clicked arrives at the latest nonempty cell under the 2 PQ Columns (first x - > 'good' under 'Blah PQ19' column, 4th x -> 1 under 'Blah PQ18' column.)
I need to replace/rename the x's with either PQ18 or PQ19 (under where the hyperlink arrives to). Does anyone know how to do this? If my explanation is unclear, please let me know. Thank you.

Code:
Dim i As Integer
Dim PCell As String

For i = 2 To 5

If Not IsEmpty(Cells(i, "CT").End(xlToRight)) Then
PCell = Cells(i, "CT").End(xlToRight).Address
ActiveSheet.Hyperlinks.Add Cells(i, 2), Address:="", SubAddress:="'" & Sheet1.Name & "'!" & PCell
End If

Next i
Attached Images
 
Reply With Quote
Reply

Tags
excel, hyperlink, vba

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT -4. The time now is 03:30 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
*PLEASE NOTE: Posts are not checked for accuracy, and do not
represent the views of the Actuarial Outpost or its sponsors.
Page generated in 0.10443 seconds with 10 queries