Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default is there a vba way to search for ### in columns before printing


Excel 2003, windows xp, sp2.

I need a vba way for users to scan sheets before printing for ### in columns
that need to be extended before printing. They are dysfunctional in looking
at print preview and are wasting time and paper.

Thanks as usual for your outstanding help.

Mike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default is there a vba way to search for ### in columns before printing

turn on the macro recorder

select all cells, then do Find and under options tell it to look at values
and uncheck whole words.


I get code like:

Cells.Select
Range("B1").Activate
Selection.Find(What:="###", After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate

you can adapt it to do this
Dim r as Range
do
set r = Cells.Find(What:="###", _
After:=ActiveCell, _
LookIn:=xlValues, LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, _
SearchFormat:=False)
if r is nothing then exit do
r.EntireColumn.Autofit
Loop

--
Regards,
Tom Ogilvy



"Mike Molyneaux" wrote:


Excel 2003, windows xp, sp2.

I need a vba way for users to scan sheets before printing for ### in columns
that need to be extended before printing. They are dysfunctional in looking
at print preview and are wasting time and paper.

Thanks as usual for your outstanding help.

Mike

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default is there a vba way to search for ### in columns before printing

Wonderful, thanks again, you guys are fantastic.
--
Mike


"Mike Molyneaux" wrote:


Excel 2003, windows xp, sp2.

I need a vba way for users to scan sheets before printing for ### in columns
that need to be extended before printing. They are dysfunctional in looking
at print preview and are wasting time and paper.

Thanks as usual for your outstanding help.

Mike

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
Search for matches in two columns Dingy101 Excel Worksheet Functions 11 December 10th 09 05:58 AM
search value in 2 columns return value in another jmegdan1 Excel Worksheet Functions 3 November 5th 08 11:57 PM
search multiple columns jason2444 Excel Discussion (Misc queries) 1 August 28th 07 10:26 PM
Search by columns or by rows davegb Excel Programming 2 June 22nd 06 02:43 PM
search 2 Columns Please Steved Excel Programming 14 February 14th 06 06:01 PM


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