Quick VB Question

  • Thread starter Thread starter mattracing
  • Start date Start date
M

mattracing

Hi,

I'm just wanting to know what this code does?

I wrote it ages ago, and I cant get it to work!!

Thanks,

Sub Connects()
Dim intRow As Integer
Dim txt As String
intRow = 1
Do Until IsEmpty(Cells(intRow, 1))
Cells(intRow, 1) = Cells(intRow, 1) & " " & Cells(intRow, 2)
Cells(intRow, 2).ClearContents
Range(Cells(intRow, 1), Cells(intRow, 2)).Merge
intRow = intRow + 1
Loop
Columns(1).AutoFit
End Sub
 
Basically it works done a range in column A and for each cell appends the
value found next door in column B. Then it deletes what was in the column B
cell and creates a single merged cell out of the col A and B cells.
 
Back
Top