Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Help Modifying Hyperlink Macro

Hello,

I currently have the following macro that converts text to a hyperlink.

Sub CovertTxt2Hyperlink()
Dim cCell As Range
Dim strHLinkBase As String

strHLinkBase =
"http://grow.hp.com/Saba/loginAsUser.jsp?deepLinkName=CourseDetail&deepLink Params=courseId="

For Each cCell In Selection.Cells

If cCell.Hyperlinks.Count = 0 Then
On Error Resume Next
ActiveSheet.Hyperlinks.Add _
Anchor:=cCell, _
Address:=strHLinkBase & cCell.Value, _
TextToDisplay:=cCell.Value
cCell.NumberFormat = "@" 'Format cell as text
End If
Next cCell
End Sub

It works great for the spreadsheets that I have used it on to date. However,
I have received a new workbook that I will be receiving quarterly that will
require modification to this macro to further automate the process of
converting the cell content to a hyperlink.

In this workbook I have 4 sheets; Welcome, Sales, Consulting & Suport. In
the last 3 sheets there is a table that has a catalog id column beginning at
D9. In the current macro I have to select the cells and then run the macro to
convert the contents. I want to change the macro so that all of the cells in
Column D, beginning at Row 9 in the Sales, Consulting & Support sheets will
be converted when the macro is run.

In addition to this change the macro needs to take several different Catalog
id formats into consideration and apply a specific action.

1) Currently this macro works fine if the format is either; 1234, 12345,
00012345, 00123456 or 01234567. In the new macro I want the hyperlink to be
the same as what it currently is written to create if it finds 1 of the 5
noted id formats.

2) Another format that is found in this column is a url. If the macro finds
this format I need the url to be retained in the hyperlink.

3) The 3rd format is an id that begins with WBT. In this case I need the
hyperlink to contain, http://grow.hp.com/Saba/Web/Main
Additionally, in this case an additional enhancement would be to add a
Comment to the cell with instructions on what to do once they are redirected
to the url.

4) The final format is that the cell may contain the word Exam. In this case
I don't want any hyperlink to be created.

Any assistance in whole or in part would be greatly appreciated. Please let
me know if any additional information is required.

--
Regards,
Chris
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Help Modifying Hyperlink Macro

I forgot to note that this is for Excel 2003.
--
Regards,
Chris


"eckert1961" wrote:

Hello,

I currently have the following macro that converts text to a hyperlink.

Sub CovertTxt2Hyperlink()
Dim cCell As Range
Dim strHLinkBase As String

strHLinkBase =
"http://grow.hp.com/Saba/loginAsUser.jsp?deepLinkName=CourseDetail&deepLink Params=courseId="

For Each cCell In Selection.Cells

If cCell.Hyperlinks.Count = 0 Then
On Error Resume Next
ActiveSheet.Hyperlinks.Add _
Anchor:=cCell, _
Address:=strHLinkBase & cCell.Value, _
TextToDisplay:=cCell.Value
cCell.NumberFormat = "@" 'Format cell as text
End If
Next cCell
End Sub

It works great for the spreadsheets that I have used it on to date. However,
I have received a new workbook that I will be receiving quarterly that will
require modification to this macro to further automate the process of
converting the cell content to a hyperlink.

In this workbook I have 4 sheets; Welcome, Sales, Consulting & Suport. In
the last 3 sheets there is a table that has a catalog id column beginning at
D9. In the current macro I have to select the cells and then run the macro to
convert the contents. I want to change the macro so that all of the cells in
Column D, beginning at Row 9 in the Sales, Consulting & Support sheets will
be converted when the macro is run.

In addition to this change the macro needs to take several different Catalog
id formats into consideration and apply a specific action.

1) Currently this macro works fine if the format is either; 1234, 12345,
00012345, 00123456 or 01234567. In the new macro I want the hyperlink to be
the same as what it currently is written to create if it finds 1 of the 5
noted id formats.

2) Another format that is found in this column is a url. If the macro finds
this format I need the url to be retained in the hyperlink.

3) The 3rd format is an id that begins with WBT. In this case I need the
hyperlink to contain, http://grow.hp.com/Saba/Web/Main
Additionally, in this case an additional enhancement would be to add a
Comment to the cell with instructions on what to do once they are redirected
to the url.

4) The final format is that the cell may contain the word Exam. In this case
I don't want any hyperlink to be created.

Any assistance in whole or in part would be greatly appreciated. Please let
me know if any additional information is required.

--
Regards,
Chris

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default Help Modifying Hyperlink Macro

Why not a double click event that uses a cell value instead. I do this with
my menu sheet.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Application.DisplayAlerts = False
Dim WantedSheet As String
WantedSheet = Trim(ActiveCell.Value)
If WantedSheet = "" Then Exit Sub
On Error Resume Next
If Sheets(WantedSheet) Is Nothing Then
GetWorkbook ' calls another macro to do that
Else
Application.GoTo Sheets(WantedSheet).Range("a4")
End If
Application.DisplayAlerts = True
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"eckert1961" wrote in message
...
Hello,

I currently have the following macro that converts text to a hyperlink.

Sub CovertTxt2Hyperlink()
Dim cCell As Range
Dim strHLinkBase As String

strHLinkBase =
"http://grow.hp.com/Saba/loginAsUser.jsp?deepLinkName=CourseDetail&deepLink Params=courseId="

For Each cCell In Selection.Cells

If cCell.Hyperlinks.Count = 0 Then
On Error Resume Next
ActiveSheet.Hyperlinks.Add _
Anchor:=cCell, _
Address:=strHLinkBase & cCell.Value, _
TextToDisplay:=cCell.Value
cCell.NumberFormat = "@" 'Format cell as text
End If
Next cCell
End Sub

It works great for the spreadsheets that I have used it on to date.
However,
I have received a new workbook that I will be receiving quarterly that
will
require modification to this macro to further automate the process of
converting the cell content to a hyperlink.

In this workbook I have 4 sheets; Welcome, Sales, Consulting & Suport. In
the last 3 sheets there is a table that has a catalog id column beginning
at
D9. In the current macro I have to select the cells and then run the macro
to
convert the contents. I want to change the macro so that all of the cells
in
Column D, beginning at Row 9 in the Sales, Consulting & Support sheets
will
be converted when the macro is run.

In addition to this change the macro needs to take several different
Catalog
id formats into consideration and apply a specific action.

1) Currently this macro works fine if the format is either; 1234, 12345,
00012345, 00123456 or 01234567. In the new macro I want the hyperlink to
be
the same as what it currently is written to create if it finds 1 of the 5
noted id formats.

2) Another format that is found in this column is a url. If the macro
finds
this format I need the url to be retained in the hyperlink.

3) The 3rd format is an id that begins with WBT. In this case I need the
hyperlink to contain,
http://grow.hp.com/Saba/Web/Main
Additionally, in this case an additional enhancement would be to add a
Comment to the cell with instructions on what to do once they are
redirected
to the url.

4) The final format is that the cell may contain the word Exam. In this
case
I don't want any hyperlink to be created.

Any assistance in whole or in part would be greatly appreciated. Please
let
me know if any additional information is required.

--
Regards,
Chris


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Help Modifying Hyperlink Macro

Thanks for the reply Don. Unfortunately, I'm not well versed enough in VB to
fully understand how your code should be modified to accomplish what I need.
If you wouldn't mind could you provide some additional information? Thanks.
--
Regards,
Chris


"Don Guillett" wrote:

Why not a double click event that uses a cell value instead. I do this with
my menu sheet.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Application.DisplayAlerts = False
Dim WantedSheet As String
WantedSheet = Trim(ActiveCell.Value)
If WantedSheet = "" Then Exit Sub
On Error Resume Next
If Sheets(WantedSheet) Is Nothing Then
GetWorkbook ' calls another macro to do that
Else
Application.GoTo Sheets(WantedSheet).Range("a4")
End If
Application.DisplayAlerts = True
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"eckert1961" wrote in message
...
Hello,

I currently have the following macro that converts text to a hyperlink.

Sub CovertTxt2Hyperlink()
Dim cCell As Range
Dim strHLinkBase As String

strHLinkBase =
"http://grow.hp.com/Saba/loginAsUser.jsp?deepLinkName=CourseDetail&deepLink Params=courseId="

For Each cCell In Selection.Cells

If cCell.Hyperlinks.Count = 0 Then
On Error Resume Next
ActiveSheet.Hyperlinks.Add _
Anchor:=cCell, _
Address:=strHLinkBase & cCell.Value, _
TextToDisplay:=cCell.Value
cCell.NumberFormat = "@" 'Format cell as text
End If
Next cCell
End Sub

It works great for the spreadsheets that I have used it on to date.
However,
I have received a new workbook that I will be receiving quarterly that
will
require modification to this macro to further automate the process of
converting the cell content to a hyperlink.

In this workbook I have 4 sheets; Welcome, Sales, Consulting & Suport. In
the last 3 sheets there is a table that has a catalog id column beginning
at
D9. In the current macro I have to select the cells and then run the macro
to
convert the contents. I want to change the macro so that all of the cells
in
Column D, beginning at Row 9 in the Sales, Consulting & Support sheets
will
be converted when the macro is run.

In addition to this change the macro needs to take several different
Catalog
id formats into consideration and apply a specific action.

1) Currently this macro works fine if the format is either; 1234, 12345,
00012345, 00123456 or 01234567. In the new macro I want the hyperlink to
be
the same as what it currently is written to create if it finds 1 of the 5
noted id formats.

2) Another format that is found in this column is a url. If the macro
finds
this format I need the url to be retained in the hyperlink.

3) The 3rd format is an id that begins with WBT. In this case I need the
hyperlink to contain,
http://grow.hp.com/Saba/Web/Main
Additionally, in this case an additional enhancement would be to add a
Comment to the cell with instructions on what to do once they are
redirected
to the url.

4) The final format is that the cell may contain the word Exam. In this
case
I don't want any hyperlink to be created.

Any assistance in whole or in part would be greatly appreciated. Please
let
me know if any additional information is required.

--
Regards,
Chris


.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default Help Modifying Hyperlink Macro

If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"eckert1961" wrote in message
...
Thanks for the reply Don. Unfortunately, I'm not well versed enough in VB
to
fully understand how your code should be modified to accomplish what I
need.
If you wouldn't mind could you provide some additional information?
Thanks.
--
Regards,
Chris


"Don Guillett" wrote:

Why not a double click event that uses a cell value instead. I do this
with
my menu sheet.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Application.DisplayAlerts = False
Dim WantedSheet As String
WantedSheet = Trim(ActiveCell.Value)
If WantedSheet = "" Then Exit Sub
On Error Resume Next
If Sheets(WantedSheet) Is Nothing Then
GetWorkbook ' calls another macro to do that
Else
Application.GoTo Sheets(WantedSheet).Range("a4")
End If
Application.DisplayAlerts = True
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"eckert1961" wrote in message
...
Hello,

I currently have the following macro that converts text to a hyperlink.

Sub CovertTxt2Hyperlink()
Dim cCell As Range
Dim strHLinkBase As String

strHLinkBase =
"http://grow.hp.com/Saba/loginAsUser.jsp?deepLinkName=CourseDetail&deepLink Params=courseId="

For Each cCell In Selection.Cells

If cCell.Hyperlinks.Count = 0 Then
On Error Resume Next
ActiveSheet.Hyperlinks.Add _
Anchor:=cCell, _
Address:=strHLinkBase & cCell.Value, _
TextToDisplay:=cCell.Value
cCell.NumberFormat = "@" 'Format cell as text
End If
Next cCell
End Sub

It works great for the spreadsheets that I have used it on to date.
However,
I have received a new workbook that I will be receiving quarterly that
will
require modification to this macro to further automate the process of
converting the cell content to a hyperlink.

In this workbook I have 4 sheets; Welcome, Sales, Consulting & Suport.
In
the last 3 sheets there is a table that has a catalog id column
beginning
at
D9. In the current macro I have to select the cells and then run the
macro
to
convert the contents. I want to change the macro so that all of the
cells
in
Column D, beginning at Row 9 in the Sales, Consulting & Support sheets
will
be converted when the macro is run.

In addition to this change the macro needs to take several different
Catalog
id formats into consideration and apply a specific action.

1) Currently this macro works fine if the format is either; 1234,
12345,
00012345, 00123456 or 01234567. In the new macro I want the hyperlink
to
be
the same as what it currently is written to create if it finds 1 of the
5
noted id formats.

2) Another format that is found in this column is a url. If the macro
finds
this format I need the url to be retained in the hyperlink.

3) The 3rd format is an id that begins with WBT. In this case I need
the
hyperlink to contain,
http://grow.hp.com/Saba/Web/Main
Additionally, in this case an additional enhancement would be to add a
Comment to the cell with instructions on what to do once they are
redirected
to the url.

4) The final format is that the cell may contain the word Exam. In this
case
I don't want any hyperlink to be created.

Any assistance in whole or in part would be greatly appreciated. Please
let
me know if any additional information is required.

--
Regards,
Chris


.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Help Modifying Hyperlink Macro

Thanks Dan. I will put the file together and forward it to your email address.
--
Regards,
Chris


"Don Guillett" wrote:

If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"eckert1961" wrote in message
...
Thanks for the reply Don. Unfortunately, I'm not well versed enough in VB
to
fully understand how your code should be modified to accomplish what I
need.
If you wouldn't mind could you provide some additional information?
Thanks.
--
Regards,
Chris


"Don Guillett" wrote:

Why not a double click event that uses a cell value instead. I do this
with
my menu sheet.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Application.DisplayAlerts = False
Dim WantedSheet As String
WantedSheet = Trim(ActiveCell.Value)
If WantedSheet = "" Then Exit Sub
On Error Resume Next
If Sheets(WantedSheet) Is Nothing Then
GetWorkbook ' calls another macro to do that
Else
Application.GoTo Sheets(WantedSheet).Range("a4")
End If
Application.DisplayAlerts = True
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"eckert1961" wrote in message
...
Hello,

I currently have the following macro that converts text to a hyperlink.

Sub CovertTxt2Hyperlink()
Dim cCell As Range
Dim strHLinkBase As String

strHLinkBase =
"http://grow.hp.com/Saba/loginAsUser.jsp?deepLinkName=CourseDetail&deepLink Params=courseId="

For Each cCell In Selection.Cells

If cCell.Hyperlinks.Count = 0 Then
On Error Resume Next
ActiveSheet.Hyperlinks.Add _
Anchor:=cCell, _
Address:=strHLinkBase & cCell.Value, _
TextToDisplay:=cCell.Value
cCell.NumberFormat = "@" 'Format cell as text
End If
Next cCell
End Sub

It works great for the spreadsheets that I have used it on to date.
However,
I have received a new workbook that I will be receiving quarterly that
will
require modification to this macro to further automate the process of
converting the cell content to a hyperlink.

In this workbook I have 4 sheets; Welcome, Sales, Consulting & Suport.
In
the last 3 sheets there is a table that has a catalog id column
beginning
at
D9. In the current macro I have to select the cells and then run the
macro
to
convert the contents. I want to change the macro so that all of the
cells
in
Column D, beginning at Row 9 in the Sales, Consulting & Support sheets
will
be converted when the macro is run.

In addition to this change the macro needs to take several different
Catalog
id formats into consideration and apply a specific action.

1) Currently this macro works fine if the format is either; 1234,
12345,
00012345, 00123456 or 01234567. In the new macro I want the hyperlink
to
be
the same as what it currently is written to create if it finds 1 of the
5
noted id formats.

2) Another format that is found in this column is a url. If the macro
finds
this format I need the url to be retained in the hyperlink.

3) The 3rd format is an id that begins with WBT. In this case I need
the
hyperlink to contain,
http://grow.hp.com/Saba/Web/Main
Additionally, in this case an additional enhancement would be to add a
Comment to the cell with instructions on what to do once they are
redirected
to the url.

4) The final format is that the cell may contain the word Exam. In this
case
I don't want any hyperlink to be created.

Any assistance in whole or in part would be greatly appreciated. Please
let
me know if any additional information is required.

--
Regards,
Chris

.


.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Help Modifying Hyperlink Macro

Hello Don,

I just forwarded the email. My apologies for mistyping your name in my
previous reply.
--
Regards,
Chris


"eckert1961" wrote:

Thanks Don. I will put the file together and forward it to your email address.
--
Regards,
Chris


"Don Guillett" wrote:

If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"eckert1961" wrote in message
...
Thanks for the reply Don. Unfortunately, I'm not well versed enough in VB
to
fully understand how your code should be modified to accomplish what I
need.
If you wouldn't mind could you provide some additional information?
Thanks.
--
Regards,
Chris


"Don Guillett" wrote:

Why not a double click event that uses a cell value instead. I do this
with
my menu sheet.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Application.DisplayAlerts = False
Dim WantedSheet As String
WantedSheet = Trim(ActiveCell.Value)
If WantedSheet = "" Then Exit Sub
On Error Resume Next
If Sheets(WantedSheet) Is Nothing Then
GetWorkbook ' calls another macro to do that
Else
Application.GoTo Sheets(WantedSheet).Range("a4")
End If
Application.DisplayAlerts = True
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"eckert1961" wrote in message
...
Hello,

I currently have the following macro that converts text to a hyperlink.

Sub CovertTxt2Hyperlink()
Dim cCell As Range
Dim strHLinkBase As String

strHLinkBase =
"http://grow.hp.com/Saba/loginAsUser.jsp?deepLinkName=CourseDetail&deepLink Params=courseId="

For Each cCell In Selection.Cells

If cCell.Hyperlinks.Count = 0 Then
On Error Resume Next
ActiveSheet.Hyperlinks.Add _
Anchor:=cCell, _
Address:=strHLinkBase & cCell.Value, _
TextToDisplay:=cCell.Value
cCell.NumberFormat = "@" 'Format cell as text
End If
Next cCell
End Sub

It works great for the spreadsheets that I have used it on to date.
However,
I have received a new workbook that I will be receiving quarterly that
will
require modification to this macro to further automate the process of
converting the cell content to a hyperlink.

In this workbook I have 4 sheets; Welcome, Sales, Consulting & Suport.
In
the last 3 sheets there is a table that has a catalog id column
beginning
at
D9. In the current macro I have to select the cells and then run the
macro
to
convert the contents. I want to change the macro so that all of the
cells
in
Column D, beginning at Row 9 in the Sales, Consulting & Support sheets
will
be converted when the macro is run.

In addition to this change the macro needs to take several different
Catalog
id formats into consideration and apply a specific action.

1) Currently this macro works fine if the format is either; 1234,
12345,
00012345, 00123456 or 01234567. In the new macro I want the hyperlink
to
be
the same as what it currently is written to create if it finds 1 of the
5
noted id formats.

2) Another format that is found in this column is a url. If the macro
finds
this format I need the url to be retained in the hyperlink.

3) The 3rd format is an id that begins with WBT. In this case I need
the
hyperlink to contain,
http://grow.hp.com/Saba/Web/Main
Additionally, in this case an additional enhancement would be to add a
Comment to the cell with instructions on what to do once they are
redirected
to the url.

4) The final format is that the cell may contain the word Exam. In this
case
I don't want any hyperlink to be created.

Any assistance in whole or in part would be greatly appreciated. Please
let
me know if any additional information is required.

--
Regards,
Chris

.


.

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default Help Modifying Hyperlink Macro

Basic idea presented in a worksheet event

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Target.Column < 4 Then Exit Sub
mv = Target
ActiveWorkbook.FollowHyperlink Address:= _
"http://finance.yahoo.com/q?s=" & mv
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"eckert1961" wrote in message
...
Hello Don,

I just forwarded the email. My apologies for mistyping your name in my
previous reply.
--
Regards,
Chris


"eckert1961" wrote:

Thanks Don. I will put the file together and forward it to your email
address.
--
Regards,
Chris


"Don Guillett" wrote:

If desired, send your file to my address below. I will only look
if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"eckert1961" wrote in message
...
Thanks for the reply Don. Unfortunately, I'm not well versed enough
in VB
to
fully understand how your code should be modified to accomplish what
I
need.
If you wouldn't mind could you provide some additional information?
Thanks.
--
Regards,
Chris


"Don Guillett" wrote:

Why not a double click event that uses a cell value instead. I do
this
with
my menu sheet.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range,
Cancel As
Boolean)
Application.DisplayAlerts = False
Dim WantedSheet As String
WantedSheet = Trim(ActiveCell.Value)
If WantedSheet = "" Then Exit Sub
On Error Resume Next
If Sheets(WantedSheet) Is Nothing Then
GetWorkbook ' calls another macro to do that
Else
Application.GoTo Sheets(WantedSheet).Range("a4")
End If
Application.DisplayAlerts = True
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"eckert1961" wrote in message
...
Hello,

I currently have the following macro that converts text to a
hyperlink.

Sub CovertTxt2Hyperlink()
Dim cCell As Range
Dim strHLinkBase As String

strHLinkBase =
"http://grow.hp.com/Saba/loginAsUser.jsp?deepLinkName=CourseDetail&deepLink Params=courseId="

For Each cCell In Selection.Cells

If cCell.Hyperlinks.Count = 0 Then
On Error Resume Next
ActiveSheet.Hyperlinks.Add _
Anchor:=cCell, _
Address:=strHLinkBase & cCell.Value, _
TextToDisplay:=cCell.Value
cCell.NumberFormat = "@" 'Format cell as text
End If
Next cCell
End Sub

It works great for the spreadsheets that I have used it on to
date.
However,
I have received a new workbook that I will be receiving quarterly
that
will
require modification to this macro to further automate the process
of
converting the cell content to a hyperlink.

In this workbook I have 4 sheets; Welcome, Sales, Consulting &
Suport.
In
the last 3 sheets there is a table that has a catalog id column
beginning
at
D9. In the current macro I have to select the cells and then run
the
macro
to
convert the contents. I want to change the macro so that all of
the
cells
in
Column D, beginning at Row 9 in the Sales, Consulting & Support
sheets
will
be converted when the macro is run.

In addition to this change the macro needs to take several
different
Catalog
id formats into consideration and apply a specific action.

1) Currently this macro works fine if the format is either; 1234,
12345,
00012345, 00123456 or 01234567. In the new macro I want the
hyperlink
to
be
the same as what it currently is written to create if it finds 1
of the
5
noted id formats.

2) Another format that is found in this column is a url. If the
macro
finds
this format I need the url to be retained in the hyperlink.

3) The 3rd format is an id that begins with WBT. In this case I
need
the
hyperlink to contain,
http://grow.hp.com/Saba/Web/Main
Additionally, in this case an additional enhancement would be to
add a
Comment to the cell with instructions on what to do once they are
redirected
to the url.

4) The final format is that the cell may contain the word Exam. In
this
case
I don't want any hyperlink to be created.

Any assistance in whole or in part would be greatly appreciated.
Please
let
me know if any additional information is required.

--
Regards,
Chris

.


.


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Help Modifying Hyperlink Macro

Don's code worked brilliantly.
--
Regards,
Chris


"Don Guillett" wrote:

Basic idea presented in a worksheet event

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Target.Column < 4 Then Exit Sub
mv = Target
ActiveWorkbook.FollowHyperlink Address:= _
"http://finance.yahoo.com/q?s=" & mv
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"eckert1961" wrote in message
...
Hello Don,

I just forwarded the email. My apologies for mistyping your name in my
previous reply.
--
Regards,
Chris


"eckert1961" wrote:

Thanks Don. I will put the file together and forward it to your email
address.
--
Regards,
Chris


"Don Guillett" wrote:

If desired, send your file to my address below. I will only look
if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"eckert1961" wrote in message
...
Thanks for the reply Don. Unfortunately, I'm not well versed enough
in VB
to
fully understand how your code should be modified to accomplish what
I
need.
If you wouldn't mind could you provide some additional information?
Thanks.
--
Regards,
Chris


"Don Guillett" wrote:

Why not a double click event that uses a cell value instead. I do
this
with
my menu sheet.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range,
Cancel As
Boolean)
Application.DisplayAlerts = False
Dim WantedSheet As String
WantedSheet = Trim(ActiveCell.Value)
If WantedSheet = "" Then Exit Sub
On Error Resume Next
If Sheets(WantedSheet) Is Nothing Then
GetWorkbook ' calls another macro to do that
Else
Application.GoTo Sheets(WantedSheet).Range("a4")
End If
Application.DisplayAlerts = True
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"eckert1961" wrote in message
...
Hello,

I currently have the following macro that converts text to a
hyperlink.

Sub CovertTxt2Hyperlink()
Dim cCell As Range
Dim strHLinkBase As String

strHLinkBase =
"http://grow.hp.com/Saba/loginAsUser.jsp?deepLinkName=CourseDetail&deepLink Params=courseId="

For Each cCell In Selection.Cells

If cCell.Hyperlinks.Count = 0 Then
On Error Resume Next
ActiveSheet.Hyperlinks.Add _
Anchor:=cCell, _
Address:=strHLinkBase & cCell.Value, _
TextToDisplay:=cCell.Value
cCell.NumberFormat = "@" 'Format cell as text
End If
Next cCell
End Sub

It works great for the spreadsheets that I have used it on to
date.
However,
I have received a new workbook that I will be receiving quarterly
that
will
require modification to this macro to further automate the process
of
converting the cell content to a hyperlink.

In this workbook I have 4 sheets; Welcome, Sales, Consulting &
Suport.
In
the last 3 sheets there is a table that has a catalog id column
beginning
at
D9. In the current macro I have to select the cells and then run
the
macro
to
convert the contents. I want to change the macro so that all of
the
cells
in
Column D, beginning at Row 9 in the Sales, Consulting & Support
sheets
will
be converted when the macro is run.

In addition to this change the macro needs to take several
different
Catalog
id formats into consideration and apply a specific action.

1) Currently this macro works fine if the format is either; 1234,
12345,
00012345, 00123456 or 01234567. In the new macro I want the
hyperlink
to
be
the same as what it currently is written to create if it finds 1
of the
5
noted id formats.

2) Another format that is found in this column is a url. If the
macro
finds
this format I need the url to be retained in the hyperlink.

3) The 3rd format is an id that begins with WBT. In this case I
need
the
hyperlink to contain,
http://grow.hp.com/Saba/Web/Main
Additionally, in this case an additional enhancement would be to
add a
Comment to the cell with instructions on what to do once they are
redirected
to the url.

4) The final format is that the cell may contain the word Exam. In
this
case
I don't want any hyperlink to be created.

Any assistance in whole or in part would be greatly appreciated.
Please
let
me know if any additional information is required.

--
Regards,
Chris

.


.


.

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
Help Modifying Macro Adams SC[_2_] Excel Programming 2 May 5th 09 04:20 PM
Modifying Macro simplymidori[_2_] Excel Discussion (Misc queries) 3 April 13th 08 04:17 PM
Modifying a Macro - Help Please LPS Excel Programming 6 August 14th 07 09:44 PM
Modifying hyperlink beyond default options Michael Siegel[_2_] Excel Programming 4 April 9th 07 12:58 PM
Modifying Macro carl Excel Worksheet Functions 3 August 25th 05 08:45 PM


All times are GMT +1. The time now is 09:13 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"