Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default text centering

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

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Centering text in right-side header block standard_guy Excel Discussion (Misc queries) 1 May 6th 10 12:43 AM
Centering Text Not Working caldog Excel Programming 5 December 21st 05 01:42 AM
Centering MsgBox text Patrick Excel Programming 2 February 17th 05 07:49 PM
Centering the text in a message box Rob_T Excel Programming 2 October 10th 04 01:12 AM
Centering the text in a message box Rob_T Excel Programming 4 October 8th 04 10:02 AM


All times are GMT +1. The time now is 01:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"