realniceguy5000
Board Regular
- Joined
- Aug 19, 2008
- Messages
- 148
Hi,
Note had this post on another web site but I didn't get any anwsers that helped.So I thought I would try here.
http://www.excelforum.com/excel-pro...long-possible-array-may-help.html#post2066266
I have this script below that will be very long by the time I am done entering all the cell info. I wanted to know if there may be a better way or shorter way to get the same results.
Here is what needs to happen:
When someone picks Jan 09 from my combo box for example the script should take the values from row cells c77 to n77 and place that value into row c26 to n26 and also take the values from row cells c102 to n102 and place in row c54 to n54
However if someone were to pick Feb 09 from my combo box the data should move down one row so the example would look like row c78 to n78 data displays in row c26 to n26 and row c103 to n103 data displays in row c54 to n54
So that data will always display in row c26 to n26 and c54 to n54 only where the data is pulled from should change by the value in the combo box?
Thanks for any help, Mike
Here is the code I have so far, I just think there may be a better way of to get this done? Someone suggested maybe using "CASE" and I way thinking maybe an aaray selection for the rows?
Thanks Again...<!-- / message -->
Note had this post on another web site but I didn't get any anwsers that helped.So I thought I would try here.
http://www.excelforum.com/excel-pro...long-possible-array-may-help.html#post2066266
I have this script below that will be very long by the time I am done entering all the cell info. I wanted to know if there may be a better way or shorter way to get the same results.
Here is what needs to happen:
When someone picks Jan 09 from my combo box for example the script should take the values from row cells c77 to n77 and place that value into row c26 to n26 and also take the values from row cells c102 to n102 and place in row c54 to n54
However if someone were to pick Feb 09 from my combo box the data should move down one row so the example would look like row c78 to n78 data displays in row c26 to n26 and row c103 to n103 data displays in row c54 to n54
So that data will always display in row c26 to n26 and c54 to n54 only where the data is pulled from should change by the value in the combo box?
Thanks for any help, Mike
Here is the code I have so far, I just think there may be a better way of to get this done? Someone suggested maybe using "CASE" and I way thinking maybe an aaray selection for the rows?
Code:
Private Sub ComboBox1_Change()
Dim tempValue As String
tempValue = ComboBox1.Value
'Range("C54:N54").Value = Range("C102:N102")'THIS WONT WORK
If tempValue = "Jan 09" Then
Range("C26").Value = Range("C77")
Range("D26").Value = Range("D77")
Range("E26").Value = Range("E77")
ElseIf tempValue = "Feb 09" Then
ElseIf tempValue = "Mar 09" Then
ElseIf tempValue = "Apr 09" Then
ElseIf tempValue = "May 09" Then
ElseIf tempValue = "Jun 09" Then
ElseIf tempValue = "Jul 09" Then
ElseIf tempValue = "Aug 09" Then
ElseIf tempValue = "Sep 09" Then
ElseIf tempValue = "Oct 09" Then
ElseIf tempValue = "Nov 09" Then
ElseIf tempValue = "Dec 09" Then
Else
End If
End Sub
Thanks Again...<!-- / message -->