PC Review


Reply
Thread Tools Rate Thread

Checkboxes and Cobinations

 
 
Simon - M&M
Guest
Posts: n/a
 
      19th Feb 2009
Hi all,

The problem i have at the moment is that i have to produce 20 or so reports
into a trading pack for work. The way i have approached this is to use a
userform with 20 check boxes for each report. I want to be able for example
to select reports 1,5 and 19 and only print the selected reports. I would
like to know if there is an easy way of doing this than writing out the
thousands of different combinations in code, i.e Checkbox1.value = true and
Checkbox2.value = false etc,

Here is my code so far,
thanks very much for any help.

Private Sub CommandButton1_Click()
Copies = TextBox1.Value

If CheckBox1.Value = True Then
Workbooks.Open Filename:= _
"\\mm-fpvs-01\Home\sparrett\My Documents\Trading pack print
test\Report1.xls"
Else

If CheckBox2.Value = True Then
Workbooks.Open Filename:= _
"\\mm-fpvs-01\Home\sparrett\My Documents\Trading pack print
test\Report2.xls"

Else

If CheckBox3.Value = True Then
Workbooks.Open Filename:= _
"\\mm-fpvs-01\Home\sparrett\My Documents\Trading pack print
test\Report3.xls"

End If
End If
End If
Windows("MasterPrint.xls").Activate
Range("a1").Select
ActiveCell.Value = 0
Range("b1").Value = Copies


Do Until ActiveCell.Value = Range("b1").Value


If CheckBox1.Value = True Then
Windows("Report1.xls").Activate
ActiveWindow.Visible = True
'ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
MsgBox ("print1")

If CheckBox2.Value = True Then
Windows("Report2.xls").Activate
ActiveWindow.Visible = True
'ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
MsgBox ("print2")

If CheckBox3.Value = True Then
Windows("Report3.xls").Activate
ActiveWindow.Visible = True
'ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
MsgBox ("print3")
End If
End If
End If

Windows("MasterPrint.xls").Activate
ActiveCell.Offset(1, 0).Select
ActiveCell.Formula = "=r[-1]+1"

Loop

End Sub
 
Reply With Quote
 
 
 
 
CurlyDave
Guest
Posts: n/a
 
      19th Feb 2009
Check this out

http://j-walk.com/ss/excel/tips/tip48.htm
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CheckBoxes =?Utf-8?B?YXdhY2g=?= Microsoft Access Forms 1 15th Jun 2007 01:53 AM
checkboxes =?Utf-8?B?eXZsdA==?= Microsoft Frontpage 2 27th Mar 2005 06:16 PM
Re: Checkboxes and Other Bill Renaud Microsoft Excel Programming 0 5th Apr 2004 05:09 AM
Checkboxes =?Utf-8?B?Sm9zaCBN?= Microsoft Access Getting Started 8 22nd Jan 2004 01:16 PM
checkboxes RICHARD Microsoft Excel Worksheet Functions 1 8th Jul 2003 05:00 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:11 PM.