Hyperlink Cell Reference

ryan_law2000

Well-known Member
Joined
Oct 2, 2007
Messages
738
Is there a way that under "Type the Cell Reference" that you can make it automatically change to the cell the hyperlink is on?

The reason why i ask this is because I have hyperlinks linking to there current cell but once i delete a row above that... the cell refernece doesnt change therefore changing the cell reference to the cell above it
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

ryan_law2000

Well-known Member
Joined
Oct 2, 2007
Messages
738
All of colum A from 5 down has a hyperlink opening a userform (in this userform when completed, it will delete the active row)

Example:

A6 has a hyperlink with a cell reference of A6 (which is needed)
So if A5 is clicked and finished that row will be deleted, therfore bringing A6 into the A5 spot but NOT changing the Cell Refernce of A6 to A5...
I need these cell refernces to match the current cell of the hyperlink
I hope this explanes it better, any help?
 
Upvote 0

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,358
Office Version
  1. 365
Platform
  1. Windows
ryan

Why are you using a hyperlink to open a userform?:eek:

In fact how are you actually doing that?:)
 
Upvote 0

ryan_law2000

Well-known Member
Joined
Oct 2, 2007
Messages
738
It took a while but Here are the codes:

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
UserForm1.Show
End Sub


And I go from there, I figure that a hyperlink is easier because im going to have about 500 rows in this form... Which brings up another problem
IS there a fast way to bring the hyperlinks and there correct cell refernce down through out 500 rows?
I wondering if maybe under cell refernce there could be a formula there like "curent cell" or something with that kind of idea
 
Upvote 0

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,358
Office Version
  1. 365
Platform
  1. Windows
ryan

Couldn't you just use an event like SelectionChange?
 
Upvote 0

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,358
Office Version
  1. 365
Platform
  1. Windows
ryan

If you can be more specific so can I?

What is the purpose of the userform and why the need for hyperlinks?

Let's say you want the userform to appear when the user clicks in any cell in A1:A500 and display, in a textbox, the value from the worksheet.
Code:
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Count > 1 Then Exit Sub
    If Intersect(Range("A1:A500"), Target) Is Nothing Then Exit Sub
    
    UserForm1.TextBox1 = Target.Value
    UserForm1.Show
    
End Sub
 
Upvote 0

ryan_law2000

Well-known Member
Joined
Oct 2, 2007
Messages
738
WOW that works WAY BETTER! only one problem now
When I have text in the cell that is clicked example "REMOVE"
then "REMOVE" shows up in the userform under the first text box... can i fix this?
 
Upvote 0

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,358
Office Version
  1. 365
Platform
  1. Windows
ryan

For that just remove this line.
Code:
    UserForm1.TextBox1 = Target.Value
The reason I included it was to show how you can transfer data based on the row selected to the userform.

Isn't that along the lines of what you ultimately want to do?
 
Upvote 0

ryan_law2000

Well-known Member
Joined
Oct 2, 2007
Messages
738
Never mind all got rid of the
UserForm1.TextBox1 = Target.Value

and it works absolutly perfect, thanks so much Norie
 
Upvote 0

Forum statistics

Threads
1,190,953
Messages
5,983,819
Members
439,862
Latest member
FaisalAlTawil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top