View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_4_] Bob Phillips[_4_] is offline
external usenet poster
 
Posts: 834
Default Option Box on user from to update workbook

BTW, your code can be simplified

Sub Battery_01()
'Battery_01 Macro

With Sheets("Batt Chg Rpt")
.Cells.EntireRow.Hidden = False
.PageSetup.PrintArea = "$A$1:$O$48"
.Range("O3:O4").Value = 1
.Rows("49:960").Hidden = True
End With

With Sheets("Pilot Cell Chg Rpt").Select
.Cells.EntireRow.Hidden = False
.PageSetup.PrintArea = "$A$1:$G$67"
.Rows("68:1340").Hidden = True
End With

With Sheets("Press Test Rpt").Select
.Cells.Hidden = False
.Range("A1:I1").Value = "PRESSURE TEST RECORD"
.PageSetup.PrintArea = "$A$1:$I$75"
.Rows("76:1500").Hidden = True
End With

With Sheets("Batt Strap Res Rpt").Select
.Cells.Hidden = False
.PageSetup.PrintArea = "$A$1:$J$69"
.Rows("70:1380").Hidden = True
End With
End Sub


HTH

Bob

"Brian" wrote in message
...
I have (20) Option Boxes on a User Form that are for inputing Qty. User can
check 1 Box out of the 20. Example: If user selects Option box 601, then
changes to select option box 610. Box 601 unselects automaticaly. That is
what I want them to do.

I recorded a macro for each of the 20 Option Boxes, that makes the changes
according to Option Box selected.

Option Box Names are as follows:
Option Box = Battery_String_Qty_601
Option Boxes 602-619
Option Box = Battery_String_Qty_620

What I need to do is when User selects the option box 601-620 the Codes
runs
when the Update Control Button is pushed. The User Form is a Workbook by
itself named "Master User Form".

UserForm name is "UserForm1"
Control Button is "Update_Installer_Forms_10"
Workbook being updated is "Master Installer Forms.xlsm"

I am not sure how to do this. The flow would be user picks the option box
601-620, which would tell which sub to run in the module when the Control
button is pressed.

Here is Code that I recorded to make the Changes. I have 20 Codes like
this
one. 1 for each Option Box. This code is located in module1 that I moved
from
the workbook.

Sub Battery_01()
'Battery_01 Macro

ActiveWindow.ScrollWorkbookTabs Position:=xlLast
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets("Batt Chg Rpt").Select
Cells.Select
Selection.EntireRow.Hidden = False
Range("A1:O48").Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$O$48"
Range("O3:O4").Select
ActiveCell.FormulaR1C1 = "1"
Rows("49:960").Select
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-42
Range("G6:H7").Select
Sheets("Pilot Cell Chg Rpt").Select
Cells.Select
Selection.EntireRow.Hidden = False
Range("A1:G67").Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$G$67"
ActiveWindow.SmallScroll Down:=60
Rows("68:1340").Select
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-66
Range("B11:C11").Select
Sheets("Press Test Rpt").Select
Cells.Select
Selection.EntireRow.Hidden = False
Range("A1:I1").Select
ActiveCell.FormulaR1C1 = "PRESSURE TEST RECORD"
Range("A1:I75").Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$I$75"
ActiveWindow.SmallScroll Down:=60
Rows("76:1499").Select
ActiveWindow.SmallScroll Down:=-3
ActiveWindow.LargeScroll Down:=-21
ActiveWindow.SmallScroll Down:=60
Rows("76:1500").Select
Selection.EntireRow.Hidden = True
ActiveWindow.LargeScroll Down:=-1
Range("B11:E11").Select
Sheets("Batt Strap Res Rpt").Select
Cells.Select
Selection.EntireRow.Hidden = False
Range("A1:J69").Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$J$69"
ActiveWindow.SmallScroll Down:=66
Rows("70:1380").Select
Selection.EntireRow.Hidden = True
ActiveWindow.LargeScroll Down:=-1
Range("H11:J11").Select
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("Install Pack Con").Select
End Sub