Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 02-18-2015, 01:33 PM
gmaxey gmaxey is offline Macro to copy cell info to multiple documents Windows 7 32bit Macro to copy cell info to multiple documents Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim strPath As String, strFileName As String
Dim oDoc As Word.Document
  strPath = ThisDocument.Path & Application.PathSeparator
  strFileName = Dir$(strPath & "*.doc")
  While Len(strFileName) <> 0
    If Not strFileName = ThisDocument.Name Then
      Set oDoc = Documents.Open(strFileName, , , False, , , , , , , , False)
      On Error Resume Next
      oDoc.Tables(1).Cell(3, 3).Range.Text = _
         Left(ThisDocument.Tables(1).Cell(2, 3).Range.Text, Len(ThisDocument.Tables(1).Cell(2, 3).Range.Text) - 2)
      On Error GoTo 0
      oDoc.Close wdSaveChanges
    End If
    strFileName = Dir$()
  Wend
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for find/replace (including headers and footers) for multiple documents jpb103 Word VBA 2 05-16-2014 04:59 AM
Macro to copy formula from one cell to another anwar Excel Programming 1 04-25-2014 08:27 PM
Macro to copy cell info to multiple documents sumproduct formula to pull info from multiple sheets Berk21 Excel 7 01-15-2012 11:41 AM
Macro to copy cell info to multiple documents Copy table cell formatting across multiple cells / tables pakistanray Word Tables 2 10-31-2011 08:07 AM
copy cell from sheet 2 to sheet 3 macro slipperyjim Excel Programming 1 02-18-2010 01:31 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:34 PM.


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