Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default add hyperlink without changing the cell formating

In a macro I am adding hyperlinks using the following code:

Cells(i, "H").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection,
Address:="http://blahblahbla"

Is it possible to add a hyperlink in this fashion without changing the
formating of cell?

Thanks for looking.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default add hyperlink without changing the cell formating

You could change the hyperlink "style" for the workbook.
That would have to be repeated for each workbook.
-or-
Add a couple lines of code to your existing code...
ActiveCell.Font.Underline = xlUnderlineStyleNone
ActiveCell.Font.ColorIndex = xlColorIndexAutomatic
--
Jim Cone
Portland, Oregon USA .
http://www.mediafire.com/PrimitiveSoftware .
(Extras for Excel add-in: convenience built-in)





"John"
wrote in message
...
In a macro I am adding hyperlinks using the following code:

Cells(i, "H").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection,
Address:="http://blahblahbla"

Is it possible to add a hyperlink in this fashion without changing the
formating of cell?

Thanks for looking.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default add hyperlink without changing the cell formating

hi,

With ActiveSheet
With .Cells(i, "H")
.Hyperlinks.Add .Cells(i, "H"), "http://www.google.ca/"
With .Font
.Name = "Arial"
.Size = 16
.Underline = xlUnderlineStyleNone 'StyleSingle, StyleDouble
.ColorIndex = 0
.Italic = True
End With
End With
End With


--
isabelle



Le 2011-09-22 19:51, John a écrit :
In a macro I am adding hyperlinks using the following code:

Cells(i, "H").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection,
Address:="http://blahblahbla"

Is it possible to add a hyperlink in this fashion without changing the
formating of cell?

Thanks for looking.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default add hyperlink without changing the cell formating

it will be easier to read like this

With ActiveSheet
.Hyperlinks.Add .Cells(i, "H"), "http://www.google.ca/"
With .Cells(i, "H").Font
.Name = "Arial"
.Size = 16
.Underline = xlUnderlineStyleNone
.ColorIndex = 0
.Italic = True
End With
End With

--
isabelle

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 91
Default add hyperlink without changing the cell formating

Use the following:

The application object has a property
(Application.AutoFormatAsYouTypeReplaceHyperlinks )which decides
whether excel will replace the formatting of the cell where one URL or
mail id present

The advantage is that it will be applicable for all such cell.You need
not change the font of all cell containing the URL/Mail Id.


Application.AutoFormatAsYouTypeReplaceHyperlinks=F alse
Activesheet.Hyperlinks.Add anchor:=range("H:"&i),Address:="http://
blahblahbla"



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default add hyperlink without changing the cell formating

On Sep 22, 5:51*pm, John wrote:
In a macro I am adding hyperlinks using the following code:


Thank you for all the responses thus far. I will experiment with the
suggestions soon. In addition to teh font color and underline I have
seen in my case that the vertical alignment is also changed, makes me
wonder how many other parameters are changed when adding a hyperlink.

Before I posted my inquiry I did do a internet search on the question
and I came across the following discussion which had some promise but
I did not get enough detail from the discussion to make any progress.
The process described in this discussion looks ideal, if anyone can
shed some insight on how to make it work that would be of interest
also.

http://www.vbforums.com/showthread.php?t=431152

Have a good day all!
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default add hyperlink without changing the cell formating

hi,

use the macro recorder and manually make the changes you are interested and then examine the code

--
isabelle

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
text changing in hyperlink cell in Excel MLT Excel Discussion (Misc queries) 1 October 11th 08 09:03 PM
changing the name of a hyperlink cell when copied BROCK8292 Excel Discussion (Misc queries) 3 September 20th 07 11:40 PM
copying a cell and changing the formating from number to text Mark Gloves Excel Discussion (Misc queries) 3 June 22nd 07 01:51 AM
How to remove Hyperlink without changing cell format? JAB Excel Worksheet Functions 1 January 20th 06 07:08 PM
Changing the Hyperlink in a cell Michael Kintner[_2_] Excel Programming 2 October 24th 03 09:15 PM


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