View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default How to add prefix to names in a column

Hi,

Am Sun, 30 Aug 2015 11:29:30 -0700 (PDT) schrieb
:

I have 1000 plant names in a column I want to add the prefix "http://www.google.com/images?q=" to


"Acer Campestre"

and so on become

http://www.google.com/images?q=Acer Campestre

your names in column A. Then try:

Sub Hyp()
Dim LRow As Long, i As Long

Const myStr = "http://www.google.com/images?q="
With ActiveSheet
LRow = .Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To LRow
.Hyperlinks.Add _
anchor:=.Cells(i, 1), _
Address:=myStr & .Cells(i, 1)
Next
End With
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional