View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Formatting text in specific cell

Hi Tim.

I want to use VBA to create a table in Word


This is probably more appropriate to a Word NG, but turn on Word's macro
recorder while you perform the operation manually. This will provide you
with code which can be edited for generic application.

format specific cells so that the text in them is either Left,
Right or Centred. I have tried using the Cells object but
get nowhere.


If this question id Excel based, to left, right or centre align a cell try:

Range("A1").HorizontalAlignment = xlLeft
Range("A1").HorizontalAlignment = xlRight
Range("A1").HorizontalAlignment = xlCenter

If this is word related, return to the macro recorder for the requisite
syntax.

---
Regards,
Norman


"tim" wrote in message
...
Hi everyone.
I want to use VBA to create a table in Word and format specific cells so
that the text in them is either Left, Right or Centred. I have tried using
the Cells object but get nowhere.

Anyone able to help?

Thanks
Tim