Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default hyperlink to changing field depending on input

Hi,

I have two fields in the first workbook where an user can enter two numbers.
I would like to create a hyperlink which takes the user in the second
workbook to a cell corresponding to the coordonates entered by the user. for
example if user enters X=10 and Y=5 the hyperlink will take him to cell J5.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default hyperlink to changing field depending on input

This code will put the hperlink at the activecell as specified in cells A1
and B1

RowNumber = Range("A1")
ColNumber = Range("B1")
Set HLink = Workbooks("book1.xls").Sheets("Sheet1").Cells(RowN umber,
ColNumber)

ActiveSheet.Hyperlinks.Add _
Anchor:=ActiveCell, _
Address:=HLink, _
TextToDisplay:=HLink.Address(external:=True)


"Stephen" wrote:

Hi,

I have two fields in the first workbook where an user can enter two numbers.
I would like to create a hyperlink which takes the user in the second
workbook to a cell corresponding to the coordonates entered by the user. for
example if user enters X=10 and Y=5 the hyperlink will take him to cell J5.

Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default hyperlink to changing field depending on input

thanks for the reply but please bear with me some more.
i don't know anything about excel programming so i am not sure what to do
with the code you sent. how should i use it.

thanks again.

"joel" wrote:

This code will put the hperlink at the activecell as specified in cells A1
and B1

RowNumber = Range("A1")
ColNumber = Range("B1")
Set HLink = Workbooks("book1.xls").Sheets("Sheet1").Cells(RowN umber,
ColNumber)

ActiveSheet.Hyperlinks.Add _
Anchor:=ActiveCell, _
Address:=HLink, _
TextToDisplay:=HLink.Address(external:=True)


"Stephen" wrote:

Hi,

I have two fields in the first workbook where an user can enter two numbers.
I would like to create a hyperlink which takes the user in the second
workbook to a cell corresponding to the coordonates entered by the user. for
example if user enters X=10 and Y=5 the hyperlink will take him to cell J5.

Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default hyperlink to changing field depending on input

This is the simpliest method

1) From worksheet enter Alt-F11 to get to VBA window
2) From VBA menu

Insert Module

3) Paste macro below from SUB .... End Sub
4) Return to worksheet by typing Alt F11
5) From worksheet menu make sure macros are enabled

Tools - Macro Security - Select Medium

If any of the higher setting was selected you have to save and exit all
workbooks. then open the workbook and when the menu comes up to enable
macros select yes.

6) Enter in A1 the row Number
Enter B1 the column Number
Select the cell where you want to hyperlink to be placed.

7) Then run macro to place hyperlink

Tools - Macro - Macro - CreateHyperlink

8) You can create a button or a shortcut key also to run macro. Try these
steps first.



Sub CreateHyperlink()
RowNumber = Range("A1")
ColNumber = Range("B1")
Set HLink = Workbooks("book1.xls").Sheets("Sheet1").Cells(RowN umber,
ColNumber)

ActiveSheet.Hyperlinks.Add _
Anchor:=ActiveCell, _
Address:=HLink, _
TextToDisplay:=HLink.Address(external:=True)
end sub


"Stephen" wrote:

thanks for the reply but please bear with me some more.
i don't know anything about excel programming so i am not sure what to do
with the code you sent. how should i use it.

thanks again.

"joel" wrote:

This code will put the hperlink at the activecell as specified in cells A1
and B1

RowNumber = Range("A1")
ColNumber = Range("B1")
Set HLink = Workbooks("book1.xls").Sheets("Sheet1").Cells(RowN umber,
ColNumber)

ActiveSheet.Hyperlinks.Add _
Anchor:=ActiveCell, _
Address:=HLink, _
TextToDisplay:=HLink.Address(external:=True)


"Stephen" wrote:

Hi,

I have two fields in the first workbook where an user can enter two numbers.
I would like to create a hyperlink which takes the user in the second
workbook to a cell corresponding to the coordonates entered by the user. for
example if user enters X=10 and Y=5 the hyperlink will take him to cell J5.

Thanks!

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default hyperlink to changing field depending on input

one step closer, still not there though.
after i run the teps above I get the following hyperlink:
[book1.xls]Sheet2!$E$10

I have replaced Sheet1 with Sheet2 because i want the hyperlink to send me
in the 2nd workbook. But dont know how to get rid of the $.

thanks.

"joel" wrote:

This is the simpliest method

1) From worksheet enter Alt-F11 to get to VBA window
2) From VBA menu

Insert Module

3) Paste macro below from SUB .... End Sub
4) Return to worksheet by typing Alt F11
5) From worksheet menu make sure macros are enabled

Tools - Macro Security - Select Medium

If any of the higher setting was selected you have to save and exit all
workbooks. then open the workbook and when the menu comes up to enable
macros select yes.

6) Enter in A1 the row Number
Enter B1 the column Number
Select the cell where you want to hyperlink to be placed.

7) Then run macro to place hyperlink

Tools - Macro - Macro - CreateHyperlink

8) You can create a button or a shortcut key also to run macro. Try these
steps first.



Sub CreateHyperlink()
RowNumber = Range("A1")
ColNumber = Range("B1")
Set HLink = Workbooks("book1.xls").Sheets("Sheet1").Cells(RowN umber,
ColNumber)

ActiveSheet.Hyperlinks.Add _
Anchor:=ActiveCell, _
Address:=HLink, _
TextToDisplay:=HLink.Address(external:=True)
end sub


"Stephen" wrote:

thanks for the reply but please bear with me some more.
i don't know anything about excel programming so i am not sure what to do
with the code you sent. how should i use it.

thanks again.

"joel" wrote:

This code will put the hperlink at the activecell as specified in cells A1
and B1

RowNumber = Range("A1")
ColNumber = Range("B1")
Set HLink = Workbooks("book1.xls").Sheets("Sheet1").Cells(RowN umber,
ColNumber)

ActiveSheet.Hyperlinks.Add _
Anchor:=ActiveCell, _
Address:=HLink, _
TextToDisplay:=HLink.Address(external:=True)


"Stephen" wrote:

Hi,

I have two fields in the first workbook where an user can enter two numbers.
I would like to create a hyperlink which takes the user in the second
workbook to a cell corresponding to the coordonates entered by the user. for
example if user enters X=10 and Y=5 the hyperlink will take him to cell J5.

Thanks!



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default hyperlink to changing field depending on input

Why do you want to get rid of the dollar signs???

RowNumber = Range("A1")
ColNumber = Range("B1")
Set HLink = Workbooks("book1.xls").Sheets("Sheet1").Cells(RowN umber,
RowNumber)
HAddr = HLink.Address(external:=True)
HAddr = Replace(HAddr, "$", "")

ActiveSheet.Hyperlinks.Add _
Anchor:=ActiveCell, _
Address:=HAddr, _
TextToDisplay:=HAddr

"Stephen" wrote:

one step closer, still not there though.
after i run the teps above I get the following hyperlink:
[book1.xls]Sheet2!$E$10

I have replaced Sheet1 with Sheet2 because i want the hyperlink to send me
in the 2nd workbook. But dont know how to get rid of the $.

thanks.

"joel" wrote:

This is the simpliest method

1) From worksheet enter Alt-F11 to get to VBA window
2) From VBA menu

Insert Module

3) Paste macro below from SUB .... End Sub
4) Return to worksheet by typing Alt F11
5) From worksheet menu make sure macros are enabled

Tools - Macro Security - Select Medium

If any of the higher setting was selected you have to save and exit all
workbooks. then open the workbook and when the menu comes up to enable
macros select yes.

6) Enter in A1 the row Number
Enter B1 the column Number
Select the cell where you want to hyperlink to be placed.

7) Then run macro to place hyperlink

Tools - Macro - Macro - CreateHyperlink

8) You can create a button or a shortcut key also to run macro. Try these
steps first.



Sub CreateHyperlink()
RowNumber = Range("A1")
ColNumber = Range("B1")
Set HLink = Workbooks("book1.xls").Sheets("Sheet1").Cells(RowN umber,
ColNumber)

ActiveSheet.Hyperlinks.Add _
Anchor:=ActiveCell, _
Address:=HLink, _
TextToDisplay:=HLink.Address(external:=True)
end sub


"Stephen" wrote:

thanks for the reply but please bear with me some more.
i don't know anything about excel programming so i am not sure what to do
with the code you sent. how should i use it.

thanks again.

"joel" wrote:

This code will put the hperlink at the activecell as specified in cells A1
and B1

RowNumber = Range("A1")
ColNumber = Range("B1")
Set HLink = Workbooks("book1.xls").Sheets("Sheet1").Cells(RowN umber,
ColNumber)

ActiveSheet.Hyperlinks.Add _
Anchor:=ActiveCell, _
Address:=HLink, _
TextToDisplay:=HLink.Address(external:=True)


"Stephen" wrote:

Hi,

I have two fields in the first workbook where an user can enter two numbers.
I would like to create a hyperlink which takes the user in the second
workbook to a cell corresponding to the coordonates entered by the user. for
example if user enters X=10 and Y=5 the hyperlink will take him to cell J5.

Thanks!

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default hyperlink to changing field depending on input

because it won't follow the hyperlink, thought that was the caused but it
seems not.
i get an error "canno open the file".
anyway i will try to check it later, see whats the cause, now i dont have
time for it.

thanks anyway for the help. it was a big push forward.

cheers.

"joel" wrote:

Why do you want to get rid of the dollar signs???

RowNumber = Range("A1")
ColNumber = Range("B1")
Set HLink = Workbooks("book1.xls").Sheets("Sheet1").Cells(RowN umber,
RowNumber)
HAddr = HLink.Address(external:=True)
HAddr = Replace(HAddr, "$", "")

ActiveSheet.Hyperlinks.Add _
Anchor:=ActiveCell, _
Address:=HAddr, _
TextToDisplay:=HAddr

"Stephen" wrote:

one step closer, still not there though.
after i run the teps above I get the following hyperlink:
[book1.xls]Sheet2!$E$10

I have replaced Sheet1 with Sheet2 because i want the hyperlink to send me
in the 2nd workbook. But dont know how to get rid of the $.

thanks.

"joel" wrote:

This is the simpliest method

1) From worksheet enter Alt-F11 to get to VBA window
2) From VBA menu

Insert Module

3) Paste macro below from SUB .... End Sub
4) Return to worksheet by typing Alt F11
5) From worksheet menu make sure macros are enabled

Tools - Macro Security - Select Medium

If any of the higher setting was selected you have to save and exit all
workbooks. then open the workbook and when the menu comes up to enable
macros select yes.

6) Enter in A1 the row Number
Enter B1 the column Number
Select the cell where you want to hyperlink to be placed.

7) Then run macro to place hyperlink

Tools - Macro - Macro - CreateHyperlink

8) You can create a button or a shortcut key also to run macro. Try these
steps first.



Sub CreateHyperlink()
RowNumber = Range("A1")
ColNumber = Range("B1")
Set HLink = Workbooks("book1.xls").Sheets("Sheet1").Cells(RowN umber,
ColNumber)

ActiveSheet.Hyperlinks.Add _
Anchor:=ActiveCell, _
Address:=HLink, _
TextToDisplay:=HLink.Address(external:=True)
end sub


"Stephen" wrote:

thanks for the reply but please bear with me some more.
i don't know anything about excel programming so i am not sure what to do
with the code you sent. how should i use it.

thanks again.

"joel" wrote:

This code will put the hperlink at the activecell as specified in cells A1
and B1

RowNumber = Range("A1")
ColNumber = Range("B1")
Set HLink = Workbooks("book1.xls").Sheets("Sheet1").Cells(RowN umber,
ColNumber)

ActiveSheet.Hyperlinks.Add _
Anchor:=ActiveCell, _
Address:=HLink, _
TextToDisplay:=HLink.Address(external:=True)


"Stephen" wrote:

Hi,

I have two fields in the first workbook where an user can enter two numbers.
I would like to create a hyperlink which takes the user in the second
workbook to a cell corresponding to the coordonates entered by the user. for
example if user enters X=10 and Y=5 the hyperlink will take him to cell J5.

Thanks!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Increasing number depending on input n_sabra64 Excel Worksheet Functions 4 November 8th 08 08:38 PM
Background Colour Depending On Input Macca Excel Discussion (Misc queries) 1 April 30th 06 01:05 AM
Function or number depending on input Jan Jansens Excel Worksheet Functions 7 September 7th 05 12:40 PM
Value or formula in cell depending on input... Jan Jansens[_2_] Excel Programming 4 September 6th 05 08:54 PM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM


All times are GMT +1. The time now is 05:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"