#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Combo Box

I am trying to copy values from a range, into an cell on another sheet,
depending of the vaue of the combo box.
but nothing happens when I change the value in the combo box
Any suggestions?
Thanks!

Private Sub ComboBoxScr_Change()

Sheets("Kick Info").Unprotect password:="driller"
Application.ScreenUpdating = False
Sheets("Volume").Select
ActiveSheet.Range("H29").Select
'If this value is 1, the mud Pump A is the Active
If ActiveCell.FormulaR1C1 = "1" Then GoTo Line1 Else GoTo Line10
Line1:
If ComboBoxScr.Value = "20" Then GoTo Line2 Else GoTo Line3
Line2:
Worksheets("Volume").Select
Range("F40").Copy
ActiveSheet.Paste Destination:=Worksheets("Kick Info").Range("B15")
GoTo Lastline
Line3:
If ComboBoxScr.Value = "25" Then GoTo Line4 Else GoTo Line5
Line4:
Worksheets("Volume").Select
Range("F41").Copy
ActiveSheet.Paste Destination:=Worksheets("Kick Info").Range("B15")
GoTo Lastline
Line5:
If ComboBoxScr.Value = "30" Then GoTo Line6 Else GoTo Line7
Line6:
Worksheets("Volume").Select
Range("F42").Copy
ActiveSheet.Paste Destination:=Worksheets("Kick Info").Range("B15")
GoTo Lastline:
Line7:
If ComboBoxScr.Value = "35" Then GoTo Line8 Else GoTo Line9
Line8:
Worksheets("Volume").Select
Range("F43").Copy
ActiveSheet.Paste Destination:=Worksheets("Kick Info").Range("B15")
GoTo Lastline:
Line9:
If ComboBoxScr.Value = "40" Then
Worksheets("Volume").Select
Range("F44").Copy
ActiveSheet.Paste Destination:=Worksheets("Kick Info").Range("B15")
End If
GoTo Lastline
Line10:
Sheets("Volume").Select
ActiveSheet.Range("H29").Select
'If this value is 1, the mud Pump B is the Active
If ActiveCell.FormulaR1C1 = "2" Then GoTo Line11 Else GoTo Line20

Line11:
Line20:
'Same as above just with mud pump B, "not finish"

Lastline:

End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Combo Box

Remoe quotation marks !!!

If ActiveCell.FormulaR1C1 = "1"Line1:
# If ActiveCell.Value = 1

If ComboBoxScr.Value = "20"
# If ComboBoxScr.Value = 20

I am trying to copy values from a range, into an cell on another sheet,
depending of the vaue of the combo box.
but nothing happens when I change the value in the combo box
Any suggestions?
Thanks!

Private Sub ComboBoxScr_Change()

Sheets("Kick Info").Unprotect password:="driller"
Application.ScreenUpdating = False
Sheets("Volume").Select
ActiveSheet.Range("H29").Select
'If this value is 1, the mud Pump A is the Active
If ActiveCell.FormulaR1C1 = "1" Then GoTo Line1 Else GoTo Line10
Line1:
If ComboBoxScr.Value = "20" Then GoTo Line2 Else GoTo Line3
Line2:
Worksheets("Volume").Select
Range("F40").Copy
ActiveSheet.Paste Destination:=Worksheets("Kick Info").Range("B15")
GoTo Lastline
Line3:
If ComboBoxScr.Value = "25" Then GoTo Line4 Else GoTo Line5
Line4:
Worksheets("Volume").Select
Range("F41").Copy
ActiveSheet.Paste Destination:=Worksheets("Kick Info").Range("B15")
GoTo Lastline
Line5:
If ComboBoxScr.Value = "30" Then GoTo Line6 Else GoTo Line7
Line6:
Worksheets("Volume").Select
Range("F42").Copy
ActiveSheet.Paste Destination:=Worksheets("Kick Info").Range("B15")
GoTo Lastline:
Line7:
If ComboBoxScr.Value = "35" Then GoTo Line8 Else GoTo Line9
Line8:
Worksheets("Volume").Select
Range("F43").Copy
ActiveSheet.Paste Destination:=Worksheets("Kick Info").Range("B15")
GoTo Lastline:
Line9:
If ComboBoxScr.Value = "40" Then
Worksheets("Volume").Select
Range("F44").Copy
ActiveSheet.Paste Destination:=Worksheets("Kick Info").Range("B15")
End If
GoTo Lastline
Line10:
Sheets("Volume").Select
ActiveSheet.Range("H29").Select
'If this value is 1, the mud Pump B is the Active
If ActiveCell.FormulaR1C1 = "2" Then GoTo Line11 Else GoTo Line20

Line11:
Line20:
'Same as above just with mud pump B, "not finish"

Lastline:

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
linking a form combo box... results from the combo box to another Trey Excel Discussion (Misc queries) 1 July 15th 07 01:58 AM
combo reference on another combo box for picking address etc. kbjin Excel Worksheet Functions 1 December 8th 06 03:29 PM
"Combo Box - getting control combo box to stick in place in worksh ajr Excel Discussion (Misc queries) 1 February 16th 05 02:05 AM
"Combo Box - getting control combo box to stick in place in worksh ajr Excel Discussion (Misc queries) 0 February 15th 05 07:45 PM
Combo Box - Hide Combo Box w/Check Box Paul Excel Programming 5 December 3rd 04 10:58 PM


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