ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Formatting text in specific cell (https://www.excelbanter.com/excel-programming/345703-formatting-text-specific-cell.html)

Tim

Formatting text in specific cell
 
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

Norman Jones

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





All times are GMT +1. The time now is 12:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com