SBaugh
Mechanical
- Mar 6, 2001
- 6,686
A couple of Questions
1) I'm wondering if a Select Case Statement can have an "And" in it?
2) If so, then...This code does seem to be working incorrectly, it puts the opposite in of what I have in the cells that it looks at. (see code below for details)
Example....If G36 = 4 and G37 = 1.5, It puts in 4x1.25. Why is that??
3) Also when I left last night it worked, (incorrectly but it worked) This morning it doesn't, What's up?
Here is my code:
Dim RiserQD3 As String
Select Case RiserQD3
Case Range("G36"
= 4 And Range("G39"
= 1.5
Range("G45"
.Select
ActiveCell = "4x1.5"
Case Range("G36"
= 4 And Range("G39"
= 1.25
Range("G45"
.Select
ActiveCell = "4x1.25"
Case Range("G36"
= 3 And Range("G39"
= 1.5
Range("G45"
.Select
ActiveCell = "3x1.5"
Case Range("G36"
= 3 And Range("G39"
= 1.25
Range("G45"
.Select
ActiveCell = "3x1.25"
Case Range("G36"
= 2.5 And Range("G39"
= 1.5
Range("G45"
.Select
ActiveCell = "2.5x1.5"
Case Range("G36"
= 2.5 And Range("G39"
= 1.25
Range("G45"
.Select
ActiveCell = "2.5x1.25"
Case Range("G36"
= 2 And Range("G39"
= 1.5
Range("G45"
.Select
ActiveCell = "2x1.5"
Case Range("G36"
= 2 And Range("G39"
= 1.25
Range("G45"
.Select
ActiveCell = "2x1.25"
End Select
Thanks to anyone that can help me understand what's going on and where I made my mistake. Scott Baugh, CSWP
George Koch Sons,LLC
Evansville, IN 47714
sjb@kochllc.com
1) I'm wondering if a Select Case Statement can have an "And" in it?
2) If so, then...This code does seem to be working incorrectly, it puts the opposite in of what I have in the cells that it looks at. (see code below for details)
Example....If G36 = 4 and G37 = 1.5, It puts in 4x1.25. Why is that??
3) Also when I left last night it worked, (incorrectly but it worked) This morning it doesn't, What's up?
Here is my code:
Dim RiserQD3 As String
Select Case RiserQD3
Case Range("G36"
Range("G45"
ActiveCell = "4x1.5"
Case Range("G36"
Range("G45"
ActiveCell = "4x1.25"
Case Range("G36"
Range("G45"
ActiveCell = "3x1.5"
Case Range("G36"
Range("G45"
ActiveCell = "3x1.25"
Case Range("G36"
Range("G45"
ActiveCell = "2.5x1.5"
Case Range("G36"
Range("G45"
ActiveCell = "2.5x1.25"
Case Range("G36"
Range("G45"
ActiveCell = "2x1.5"
Case Range("G36"
Range("G45"
ActiveCell = "2x1.25"
End Select
Thanks to anyone that can help me understand what's going on and where I made my mistake. Scott Baugh, CSWP
George Koch Sons,LLC
Evansville, IN 47714
sjb@kochllc.com