Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #25  
Old 04-01-2021, 02:42 PM
macropod's Avatar
macropod macropod is offline find and replace a number that's always in a table and always adjacent to a cell with known text Windows 10 find and replace a number that's always in a table and always adjacent to a cell with known text Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by mbcohn View Post
The number of tables in the document varies, but the changes that I want to make are always to the first table. always to the second column, and the table itself is never more than about five rows tall.
In which case:
Code:
Dim r As Long
  With wdDoc.Tables(1)
    For r = 1 To .Rows.Count
      Select Case Trim(Split(.Cell(r, 1).Range.Text, vbCr)(0))
        Case "Revision No.": .Cell(r, 2).Range.Text = "2.5"
        Case "Published": .Cell(r, 2).Range.Text = "2 April 2021"
      End Select
    Next
  End With
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
tables, vba, vba find and replace



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and Replace rows in a table based on bold text. OfficeAssociate99 Word VBA 2 07-26-2017 06:32 AM
Select Cell Text to paste into Find/Replace CBarry Word VBA 2 02-16-2017 04:37 AM
Increase number in cell, based on value in adjacent cell scottyb Excel 3 02-02-2017 03:51 AM
find and replace a number that's always in a table and always adjacent to a cell with known text VBA Table – Search All Tables - Find & Replace Text in Table Cell With Specific Background Color jc491 Word VBA 8 09-30-2015 06:10 AM
Word VBA Find Table Text Shading Colour and replace with another QA_Compliance_Advisor Word VBA 10 09-19-2014 08:36 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:29 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