VBA to Merge Cells

  • Thread starter Thread starter Darin Kramer
  • Start date Start date
D

Darin Kramer

Hi there,

Is there VBA that can merge cells on a row by row basis over a specified
column?

Eg a1,b1,c1 need to be merged
a2,c2,b2, need to be merged
etc etc to say line 200

Thanks

D
 
Sub Yourmerge()
For i = 1 To 200
Range("A" & i & ":C" & i).MergeCells = True
Next i
End Sub

Stefi
 
One more:

Option Explicit
Sub testme()
Application.DisplayAlerts = False
With ActiveSheet.Range("a1:B200")
.Merge Across:=True
End With
Application.DisplayAlerts = True
End Sub

You also have another response at your other post (non-VBA).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top