View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Filling Empty Fields

Hi Tim,

Am Thu, 4 Sep 2014 14:49:37 +0100 schrieb TimR1316:

Hi all, I'm working with 2 columns of data. One column contains urls.
The next column contains multiple attributes associated with a url.
There is a one to many relationship between these columns (see
attached). I need to fill the empty cells in the URL column with the URL
above. I've done it before - I just can't remember how I did it. I seem
to remember using ctrl-enter?? The examples I've attached show what I
have and what I need it to look like. Any help is greatly appreciated!


try:
Sub Hyp()
Dim rngC As Range
Dim LRow As Long

With ActiveSheet
LRow = .Cells(Rows.Count, 1).End(xlUp).Row
For Each rngC In Range("A1:A" & LRow)
If Len(rngC) = 0 Then
.Hyperlinks.Add _
anchor:=rngC, _
Address:=rngC.Offset(-1, 0).Hyperlinks(1).Address, _
TextToDisplay:=rngC.Text
End If
Next
End With
End Sub

To fill hyperlinks down you have to copy them down. CTRL+Enter does not
work with hyperlinks.


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