Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA to run global search/replace on close event?

Status
Not open for further replies.

TomYC

Technical User
Dec 11, 2008
191
US
I have a file with numerous worksheets. Every time I add new, imported data to the file, I must run a search and replace on one or more columns in one or more worksheets, or else my data is not "cleaned." I would like to automate this in case I forget!
Surely there is an OnClose event in which all cells in worksheets could be selected, and a search and replace operation run that strips off some unnecessary text strings, after which the file is saved, or even as part of the save process.
I have experimented with macros, would prefer code idea...
Thanks--
T.Y.
 



hi,

Please post VBA questions in forum707.

There are many Workbook Events that can be used for sheets in the workbook. You could consider the Workbook_SheetDeactivate event, Workbook_SheetChange event, Workbook_BeforeClose event just to name a few.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top