How to align the text in center

I need to align a text in center in excel using vbscript

Hi @sruthesanju

Do you need to center align the particular cell or wholecolumn?

Regards

Particular cell

Hi @sruthesanju

You can try the below macro Code.

Sub travel()

Dim cells As Range

With Range("A3")

    .Merge
    .HorizontalAlignment = xlCenter
    .VerticalAlignment = xlCenter
End With
End Sub

Regards

Please check this video:

You can write your code then in this code for align. It is very simple to do that there.

Hi @sruthesanju

Have you tried the above vba?

Regards