#1
|
|||
|
|||
GoTo Cell Reference in wdTable
Thanks in advance for solving my request: I'm looking for VBA code that would send me to a specific cell within a word table. In other words, when I launch this code a text box will appear where I could insert say (Cell 32,4) then click go and the cursor would end up at that specific cell. Thanks so much. (Office 2013)
Hdata |
#2
|
||||
|
||||
Going to a cell would only be necessary if you need to select something there, which is usually not necessary when working in VBA. So, perhaps you could explain what you're trying to achieve?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Yes, I have word tables previously setup with updateable cell formulas. I also have a list of cell references which I would like to GoTo in order to update these formulas.
Essentially you have hit the nail on the head. I want to select the contents of that cell or a range of cells in order to update formulas within that cell or range of cells without updating the entire table. Thanks for your expertise regarding VBA code. (Hdata) |
#4
|
||||
|
||||
You probably want something like
Code:
Dim oTable As Table Dim oCell As Cell If ActiveDocument.Tables.Count > 0 Then Set oTable = ActiveDocument.Tables(1) 'the first table Set oCell = oTable.Cell(1, 1) 'Row 1, Column 1 oCell.Range.Fields.Update End If
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#5
|
||||
|
||||
Quote:
Code:
Sub Demo() Application.ScreenUpdating = False Dim ArrTbls, ArrRows, ArrCols, i As Long ArrTbls = Array(1, 1, 3, 3, 4, 5) ArrRows = Array(6, 8, 6, 8, 6, 6) ArrCols = Array(4, 4, 5, 7, 2, 2) With ActiveDocument For i = 0 To UBound(ArrTbls) .Tables(ArrTbls(i)).Cell(ArrRows(i), ArrCols(i)).Range.Fields.Update Next End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
Thanks Graham
|
#7
|
|||
|
|||
Thanks Paul
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Reference Word Table Cell Using Offset? | wlcdo2 | Word VBA | 2 | 06-19-2016 08:53 PM |
Assign the value of a cell as a cell reference of another cell in Excel 2010 - How to? | bharathkumarst | Excel | 7 | 10-13-2014 10:25 AM |
Locking A Cell Reference Regardless | skoz55 | Excel | 8 | 05-16-2014 09:15 AM |
Keeping an absolute reference in a cell | bremen22 | Excel | 7 | 01-16-2014 11:06 AM |
How to reference a cell value | Jmoney2290 | Excel | 1 | 11-06-2013 09:39 PM |