Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default listing which documents were changed by macro

I have a macro which goes through hundreds of documents
and changes old product names to new product names. This
uses Excel's find and replace functions. After the macro
is finished, I would like to have a list of which
documents were changed and which were not. I have to
redistribute hard copies of the documents that were
changed, so I don't want to worry about the documents that
were not changed.

Is there a way to know whether a find/replace search for a
document made any changes or not? Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default listing which documents were changed by macro

As the macro goes through the workbooks, you should keep a list of workbooks
which have changed (in my example, the list is on a new worksheet in the
active workbook). You will know that a workbook has changed when its Saved
property is False.

For example:

Dim ws As Worksheet, wb As Workbook
Set ws = Worksheets.Add
For Each Workbook In Workbooks
If Not wb.Saved then
ws.Range("A" & Rows.Count).End(xlUp).Offset(1) = wb.Name
End If
Next

Hard to be more specific without knowing more about your code.

--

Vasant



"alan" wrote in message
...
I have a macro which goes through hundreds of documents
and changes old product names to new product names. This
uses Excel's find and replace functions. After the macro
is finished, I would like to have a list of which
documents were changed and which were not. I have to
redistribute hard copies of the documents that were
changed, so I don't want to worry about the documents that
were not changed.

Is there a way to know whether a find/replace search for a
document made any changes or not? Thanks.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro in worksheet with changed name Claireybelle90 Excel Discussion (Misc queries) 1 June 16th 09 05:00 PM
Listing multiple values in a macro ToddS Excel Worksheet Functions 6 April 8th 09 03:53 PM
Listing of excel files in My Documents bankerlady Excel Discussion (Misc queries) 0 May 21st 08 01:13 AM
Macro name listing Otto Moehrbach[_5_] Excel Programming 2 September 20th 03 04:24 PM


All times are GMT +1. The time now is 01:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"