Thread: text centering
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Halim Halim is offline
external usenet poster
 
Posts: 182
Default text centering

Alan,

You can do by this code:
Sub Centering()
With Range("a1")
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
end With
End sub

Type your text in A1 then run that code
--
Regards,

Halim



"AlanW" wrote:

I would like to centre the contents in a range by using VBA. Could someone
please help.

Thanks