Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 82
Default Copy/Paste Hyperlink Address

Hi,

I am trying to make a macro that willl copy a column containing hyperlinks
and past only the address portion of the hyperlink to another column.

Here's what I have:

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 1/14/2007 by Bonnie Hicks
'

'
Columns("B:B").Select
Selection.Copy
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 6
Columns("J:J").Select
ActiveSheet.Paste
End Sub


Can anyone tell me if I can change the Paste line to only include the
hyperlink address or another way to do this.

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default Copy/Paste Hyperlink Address

Use something like

Range("A1:A10").Copy
Range("B1").PasteSpecial xlPasteValues
Application.CutCopyMode = False


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)

"Bonnie" wrote in message
...
Hi,

I am trying to make a macro that willl copy a column containing hyperlinks
and past only the address portion of the hyperlink to another column.

Here's what I have:

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 1/14/2007 by Bonnie Hicks
'

'
Columns("B:B").Select
Selection.Copy
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 6
Columns("J:J").Select
ActiveSheet.Paste
End Sub


Can anyone tell me if I can change the Paste line to only include the
hyperlink address or another way to do this.

Thanks in advance.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Copy/Paste Hyperlink Address

Function hyp(r As Range) As String
hyp = ""
If r.Hyperlinks.Count 0 Then
hyp = r.Hyperlinks(1).Address
End If
End Function

So that in J1 enter:

=hyp(B1) and copy down
--
Gary''s Student
gsnu200701


"Bonnie" wrote:

Hi,

I am trying to make a macro that willl copy a column containing hyperlinks
and past only the address portion of the hyperlink to another column.

Here's what I have:

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 1/14/2007 by Bonnie Hicks
'

'
Columns("B:B").Select
Selection.Copy
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 6
Columns("J:J").Select
ActiveSheet.Paste
End Sub


Can anyone tell me if I can change the Paste line to only include the
hyperlink address or another way to do this.

Thanks in advance.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 82
Default Copy/Paste Hyperlink Address

Im getting an error on this - Object doesn't support this property our method.

Thanks

"Chip Pearson" wrote:

Use something like

Range("A1:A10").Copy
Range("B1").PasteSpecial xlPasteValues
Application.CutCopyMode = False


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)

"Bonnie" wrote in message
...
Hi,

I am trying to make a macro that willl copy a column containing hyperlinks
and past only the address portion of the hyperlink to another column.

Here's what I have:

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 1/14/2007 by Bonnie Hicks
'

'
Columns("B:B").Select
Selection.Copy
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 6
Columns("J:J").Select
ActiveSheet.Paste
End Sub


Can anyone tell me if I can change the Paste line to only include the
hyperlink address or another way to do this.

Thanks in advance.






  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 82
Default Copy/Paste Hyperlink Address

Thanks very much Gary. That did the trick.

Bonnie

"Gary''s Student" wrote:

Function hyp(r As Range) As String
hyp = ""
If r.Hyperlinks.Count 0 Then
hyp = r.Hyperlinks(1).Address
End If
End Function

So that in J1 enter:

=hyp(B1) and copy down
--
Gary''s Student
gsnu200701


"Bonnie" wrote:

Hi,

I am trying to make a macro that willl copy a column containing hyperlinks
and past only the address portion of the hyperlink to another column.

Here's what I have:

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 1/14/2007 by Bonnie Hicks
'

'
Columns("B:B").Select
Selection.Copy
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 6
Columns("J:J").Select
ActiveSheet.Paste
End Sub


Can anyone tell me if I can change the Paste line to only include the
hyperlink address or another way to do this.

Thanks in advance.

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Copy/Paste Hyperlink Address

You are very welcome !
--
Gary's Student
gsnu200701


"Bonnie" wrote:

Thanks very much Gary. That did the trick.

Bonnie

"Gary''s Student" wrote:

Function hyp(r As Range) As String
hyp = ""
If r.Hyperlinks.Count 0 Then
hyp = r.Hyperlinks(1).Address
End If
End Function

So that in J1 enter:

=hyp(B1) and copy down
--
Gary''s Student
gsnu200701


"Bonnie" wrote:

Hi,

I am trying to make a macro that willl copy a column containing hyperlinks
and past only the address portion of the hyperlink to another column.

Here's what I have:

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 1/14/2007 by Bonnie Hicks
'

'
Columns("B:B").Select
Selection.Copy
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 6
Columns("J:J").Select
ActiveSheet.Paste
End Sub


Can anyone tell me if I can change the Paste line to only include the
hyperlink address or another way to do this.

Thanks in advance.

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
Moving rows with Hyperlink doesn't move hyperlink address Samad Excel Discussion (Misc queries) 15 June 22nd 06 12:03 PM
Hyperlink problem to cell in same workbook stainless Excel Worksheet Functions 4 November 16th 05 08:10 AM
Hyperlink problem to cell in same workbook stainless Excel Discussion (Misc queries) 1 November 15th 05 04:53 PM
hyperlink base address RWS Excel Discussion (Misc queries) 6 November 6th 05 05:15 AM
Hyperlink Address for Charts in Excel? Buckskinner Excel Discussion (Misc queries) 1 February 19th 05 01:59 AM


All times are GMT +1. The time now is 02:25 PM.

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

About Us

"It's about Microsoft Excel"