Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default If Select is the solution - how to avoid Select

I'm looping through workbooks, establishing ranges then
printing them, but only if a 'total' is neither blank or zero.
I have:
For i = 1 To UBound(Printvarr)
If Not (IsEmpty(Pagevarr(i + 1).Offset(-1, £Col)) Or _
IsEmpty(Pagevarr(i + 1).Offset(-1, £Col)) _
Or Pagevarr(i + 1).Offset(-1, £Col).Value _
= "0.00") Then
'for testing ... toggle as required
Printvarr(i).PrintPreview
Printvarr(i).PrintOut
End If
Next

This code seems to print all ranges correctly, but includes
zero and blank pages.

If I say:

For i = 1 To UBound(Printvarr)
ws.Activate
Pagevarr(i + 1).Offset(-1, £Col).Select
If Not (IsEmpty(Pagevarr(i + 1).Offset(-1, £Col)) Or _
IsEmpty(Pagevarr(i + 1).Offset(-1, £Col)) _
Or Pagevarr(i + 1).Offset(-1, £Col).Value _
= "0.00") Then
'for testing ... toggle as required
Printvarr(i).PrintPreview
Printvarr(i).PrintOut
End If
Next

Now it seems to exclude empty and zero pages.

If I'm right, then how to Select, please?

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.688 / Virus Database: 449 - Release Date: 18/05/2004


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default If Select is the solution - how to avoid Select

If I'm right, then how to Select, please
Select What



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default If Select is the solution - how to avoid Select

Ooops.
try

If I'm right, then how to AVOID the ws.Activate and
Cell Selection, please?

Regards.


"chris" wrote in message
...
If I'm right, then how to Select, please?
Select What?





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.688 / Virus Database: 449 - Release Date: 18/05/2004


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default If Select is the solution - how to avoid Select

Stuart,

I think you need to qualify PageVarr with the worksheet name, e.g.,

ws.PageVarr

Otherwise the code is looking at the PageVarr range on the active sheet. At
least, that's what I think is going on.

hth,

Doug Glancy

"Stuart" wrote in message
...
Ooops.
try

If I'm right, then how to AVOID the ws.Activate and
Cell Selection, please?

Regards.


"chris" wrote in message
...
If I'm right, then how to Select, please?
Select What?





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.688 / Virus Database: 449 - Release Date: 18/05/2004




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
VBA: Column Select then Data Select then return to cell A1 James C[_2_] Excel Discussion (Misc queries) 3 February 1st 10 11:35 AM
Using formulas to select cells (Ex: Select every nth cell in a col Lakeview Photographic Services Excel Discussion (Misc queries) 2 March 15th 07 02:17 PM
In Excel 2000, How do you select the whole of a worksheet (Select. Rascal Excel Discussion (Misc queries) 1 March 5th 05 12:03 AM
In Excel 2000, How do you select the whole of a worksheet (Select. Rascal Excel Discussion (Misc queries) 1 March 4th 05 11:59 PM
Select other workbook to select data in a macro. T Tromp Excel Programming 2 September 19th 03 01:43 PM


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

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"