Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 683
Default Option Box on user from to update workbook

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default Option Box on user from to update workbook

Try

Select Case True

Case Me.Battery_String_Qty_601.Value: Call Sub Battery_01

'etc

End Select

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
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



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
Option Button in User Form levtweeney[_2_] Excel Programming 9 July 8th 09 07:18 PM
Forcing cell with user function to update on workbook open? Don Wiss Excel Programming 2 April 6th 07 01:30 AM
Update option button from c# Lee Excel Programming 2 March 7th 07 04:37 PM
Shared Workbook Settings, End User Update Changes Refresh Rate JESSENBE Excel Discussion (Misc queries) 0 July 19th 05 08:03 PM
Find and read/update option button David Chase Excel Programming 2 May 22nd 04 04:20 PM


All times are GMT +1. The time now is 12:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"