![]() |
#4
|
||||
|
||||
![]()
It is not quite the same as Excel, but as Greg suggests it is just a matter of setting a range to the place you want to process. e.g.
Code:
Sub Macro1() Dim oTable As Table Dim oCell As Range Set oTable = ActiveDocument.Tables(1) 'where 1 is the first table 'or 'Set oTable = Selection.Tables(1) 'which is the table the cursor is in Set oCell = oTable.Rows(1).Cells(1).Range 'the first cell in the top row oCell.End = oCell.End - 1 'omit the cell end character from the range oCell.Text = UCase(oCell.Text) 'make the cell range upper case Set oCell = Nothing Set oTable = Nothing End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
Tags |
autoformat, formatting data, vba code |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
CrossReach | Word VBA | 4 | 11-14-2017 12:51 PM |
![]() |
Bungkai | Word VBA | 1 | 12-17-2015 10:48 PM |
Add pictures in specific parts of the document and resize them automatically - MS Word 2013 | Andrew_G93 | Word | 6 | 11-10-2015 09:00 AM |
![]() |
PauledInAction | Word | 4 | 07-13-2012 02:38 PM |
![]() |
mgp69 | Word | 4 | 04-04-2012 02:12 PM |