title: Concencrate more cells in VBA with 'separator'
body: <p>I am trying to generate map from GCmap.com using the VBA code.
  I do have a long list of airport pairs in one column. The format of the hyperlink that will generate the map will be:</p>
  
  <p>"<a href="http://www.gcmap.com/map?P=" rel="nofollow">http://www.gcmap.com/map?P=</a>"&amp;(calue in .cell(1.51))&amp;"%0d%0a"&amp;(calue in .cell(2.51)&amp; so on ...</p>
  
  <p>' the %0d%0a - is a separator that needs to be between values</p>
  
  <p>the problem is that this list is a quite long and just doing simple loop will cause enormous length of hyperlink  (sometimes too long to generate the map) so it must be something like 
  if valueOfFirstCell = ValueOfCellBellow then
  ' skip to next one </p>
  
  <p>I've tried this (probably worst ever written code, but please note that I am only beginner in VBA :) </p>
  
  <pre><code>Sub hyperlinkgenerator()
  
  Dim separator As String  ' declared the 'separator' value
  separator = "%0d%0a"
  Dim datarow, irow As Integer
  Dim myval as Range
  
  With Sheets("Direct flights")
  
     Set myval = .Cells(datarow, 51)
  
     Do While myval &lt;&gt; ""     ' do until last empty row
  
  Dim Value1 As String
  Value1 = Sheets("Direct flights").Cells(datarow, 51) ' declare value of the first cell
  
  Dim Value2 As String
  
  Value2 = Sheets("Direct flights").Cells(datarow + 1, 51) ' declare value of cell bellow
  
  If Value1 = Value2 Then
  
  datarow = datarow + 1
  
  Else: 'enter Value1 in hyperlink that is followed by &amp; separator
  'also the hyperlink must start with: http://www.gcmap.com/map?P=
  ' and end with %0d%0a&amp;MS=wls&amp;MR=540&amp;MX=720x360&amp;PM=* 
  
  End If
  
  datarow = datarow + 1
  
  Loop
  
  End With
  
  End Sub
  </code></pre>
  
  <p>The final link will look like:</p>
  
  <p><a href="http://www.gcmap.com/map?P=LGW-AMS%0d%0aAMS-LHR%0d%0aLCY-AMS%0d%0aLUX-AMS%0d%0aBRE-AMS%0d%0aCWL-AMS%0d%0aNUE-AMS%0d%0aAMS-JFK%0d%0a&amp;MS=wls&amp;MR=540&amp;MX=720x360&amp;PM=" rel="nofollow">http://www.gcmap.com/map?P=LGW-AMS%0d%0aAMS-LHR%0d%0aLCY-AMS%0d%0aLUX-AMS%0d%0aBRE-AMS%0d%0aCWL-AMS%0d%0aNUE-AMS%0d%0aAMS-JFK%0d%0a&amp;MS=wls&amp;MR=540&amp;MX=720x360&amp;PM=</a>*</p>
  
  <p>I don't have a clue how to keep loop adding new and new text into Hyperlink. Also hyperlink should be generated by and opened once user will click on button (that is easy to do).</p>
  
  <p>Many thanks in advance! </p>