Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Find and Replace across all Spreadsheets

I am familar with the Access model, but I know nothing of Excel. How would
write a macro to find/replace and have it loop through every sheet in a
workbork? The number of sheets would be varialbe in all cases, but the values
for find/replace would be fixed.

Also as a side note how would I
select all Columns, then "right-size" to fit?

Thanks a ton!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Find and Replace across all Spreadsheets

Here is the find / replace code for you.

Sub ReplaceEverywhere()
Dim wks As Worksheet

For Each wks In Worksheets
wks.Cells.Replace What:="This", _
Replacement:="That", _
LookAt:=xlValues, _
MatchCase:=False
Next wks
End Sub

Try recording a macro for the Autofit and see what you get...
--
HTH...

Jim Thomlinson


"Plumdodge" wrote:

I am familar with the Access model, but I know nothing of Excel. How would
write a macro to find/replace and have it loop through every sheet in a
workbork? The number of sheets would be varialbe in all cases, but the values
for find/replace would be fixed.

Also as a side note how would I
select all Columns, then "right-size" to fit?

Thanks a ton!

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
Find and Replace - Replace with Blank Space Studebaker Excel Discussion (Misc queries) 4 April 3rd 23 10:55 AM
where to put results of find operation in find and replace functio DEP Excel Worksheet Functions 5 November 15th 06 07:52 PM
find and replace - replace data in rows to separated by commas msdker Excel Worksheet Functions 1 April 15th 06 01:00 AM
Replace method - cannot find any data to replace Mike Excel Programming 5 April 6th 06 08:56 PM
Sluggish Search and Replace on Linked Spreadsheets David Excel Discussion (Misc queries) 0 February 11th 05 06:33 PM


All times are GMT +1. The time now is 01:29 PM.

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

About Us

"It's about Microsoft Excel"