Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
text changing in hyperlink cell in Excel | Excel Discussion (Misc queries) | |||
changing the name of a hyperlink cell when copied | Excel Discussion (Misc queries) | |||
copying a cell and changing the formating from number to text | Excel Discussion (Misc queries) | |||
How to remove Hyperlink without changing cell format? | Excel Worksheet Functions | |||
Changing the Hyperlink in a cell | Excel Programming |