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: 47
Default Add to finally successful dialog box

I must say that learning how to do my first dialog box and
getting the code to work was QUITE a bit larger task than
I thought it would be. But with help from you guys,
especially Steve who stayed with me all the way, I got it
to work, except for some fine tuning.

I have 4 cases completed with the 5th to come. If the user
wants to print all 4 ranges, then I have to figure out how
to go about setting it up to select 4 separate ranges on 4
separate sheets of the workbook. Can that be done in the
Cases as shown in the completed procedure to date?

In other words, is there a way to specify 4 ranges in a
set printthisrange statement? For example, I tried this
statement below with no success:

Set Printthisrange = Range
("OBACGG","OBADEFS","OBAAgave","OBATWML")

From locking up the machine, it seems I have to do all my
selecting and then I have to close the dialog box before I
try and do a print preview obviusly. So, I am trying to
not have to loop back into the dialog box.

__________________________________________________ ________
Private Sub btnprint1_Click()
Dim Printthisrange
Dim mysheet As Worksheet

Select Case True
Case OptCNGOBA.Value
Set Printthisrange = Range("OBACGG")
Set mysheet = Worksheets("OBA CGG")
Case OptDEFSOBA.Value
Set Printthisrange = Range("OBADEFS")
Set mysheet = Worksheets("OBA DEFS")
Case OptAgaveOBA.Value
Set Printthisrange = Range("OBAAgave")
Set mysheet = Worksheets("OBA Agave")
Case OptTWMLOBA.Value
Set Printthisrange = Range("OBATWML")
Set mysheet = Worksheets("OBA TWML")
Case Optalloba

End Select

With mysheet.PageSetup
.PrintTitleRows = ""
.PaperSize = xlPaperLegal
.FitToPagesWide = 1
.FitToPagesTall = 1
.Orientation = xlLandscape
End With

Unload Me
Printthisrange.PrintPreview
Printthisrange = "Nothing"
Range("a1").Select


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
Row # of successful vlookup Chuck M Excel Worksheet Functions 3 August 19th 08 09:29 PM
Formula apparently successful but #VALUE displayed Matthew Leingang Excel Worksheet Functions 2 January 22nd 08 03:32 PM
Finally, a legitimate Excel 2007 crash ilia Excel Discussion (Misc queries) 2 November 7th 07 04:23 PM
Finally works, but only for ME...! TheMilkGuy Excel Discussion (Misc queries) 3 August 20th 07 04:06 PM
Calculating time between successful data transmissions Donnie Excel Discussion (Misc queries) 2 December 10th 04 12:45 PM


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