Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-25-2021, 09:35 AM
eduzs eduzs is offline VBA to align left cells table Windows 10 VBA to align left cells table Office 2019
Expert
VBA to align left cells table
 
Join Date: May 2017
Posts: 266
eduzs is on a distinguished road
Default

Thanks Guessed, works fine!
I also did this using select.

Code:
Dim oTbl As Table
Set oTbl = ActiveDocument.Tables(1)
With oTbl
    .Range.Columns(2).Select
    Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
    .Cell(1, 2).Select
    Selection.Range.ParagraphFormat.Alignment = wdAlignParagraphCenter
End With
Set oTbl = Nothing
Just another question, is there a way to set a range of vertical cells from the start cell to the end cell, instead of one left to right and top to bottom?



Code:
Set oRng = ActiveDocument.Range(Start:=oTbl.Cell(2, 2).Range.Start, End:=oTbl.Cell(5, 2).Range.End)
__________________
Backup your original file before doing any modification.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA to align left cells table Align...both left and right? supersimu Word 1 01-25-2014 02:05 AM
VBA to align left cells table Unable to vertically center align texts in table cells? tinfanide Word 3 11-24-2013 06:37 AM
VBA to align left cells table How to Sort Table Cells from Left to Right tamaracklodge Word Tables 4 03-04-2013 04:00 AM
VBA to align left cells table How to align page to left side instead of centre ghumdinger Word 2 08-18-2011 10:15 AM
How do I align image at ABSOLUTE top left of a table cell? shnoozin Outlook 0 07-22-2011 03:30 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:05 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft