LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Assistance needed with Macro Modification

Some of the workbooks that I use have anywhere between 5-15 spreadsheets, but
when its open only a few of those will actually be used or have any changes
made in them. So... Is there a way to adjust the macro below so that it will
only run in the spreadsheets that had changes made while the workbook was
open?

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim wS As Worksheet
Dim c As Range
For Each wS In Worksheets
For Each c In wS.UsedRange
If Not c.HasFormula Then
c.Value = Trim(c.Value)
End If
Next c
Next wS
ThisWorkbook.Save
End Sub
 
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
Paste Special Macro Assistance needed akemeny Excel Programming 5 October 7th 08 02:22 PM
Ron De Bruin Code modification needed when naming copied worksheet Corey Excel Programming 2 July 14th 06 02:54 AM
Macro Compiles Sheets to One Book...Small Modification Needed TEAM[_7_] Excel Programming 1 September 15th 05 06:12 PM
Macro assistance needed HJ Excel Programming 3 November 2nd 04 10:46 PM
Formula Modification Needed Phil Hageman[_3_] Excel Programming 4 December 18th 03 07:19 PM


All times are GMT +1. The time now is 03:19 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"