MERGE CELLS

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

HI,
I WANT TO MERGE CELLS A2:A3 AND THEN ALIGN THR TEXT INSIDE VERTICALLY AND
HORIZONTALLY CENTERED.

Range("A2:A3").MergeCells = True

ActiveSheet.Cells(2, 1).HorizontalAlignment = xlCenter
ActiveSheet.Cells(2, 1).VerticalAlignment = xlVAlignCenter

THE CODE ABOVE DOES NOTHING.

CAN ANYBODY HELP ME?
THANKS
 
SORRY,
I FOUND MYSELF:

ActiveSheet.Cells(2, 1).HorizontalAlignment = xlCenter
ActiveSheet.Cells(2, 1).VerticalAlignment = xlVAlignCenter
Range("A2:A3").MergeCells = True
 
Try:-

Sub testttt()
Range("A2:A3").Select
With Selection
.Merge
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlVAlignCenter
End With


End Sub

HTH
 

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