Cell D9 varies based on inputs from another cell. The value in cell D9 could be 1, 2, or 3.
If D9 is a 1, then range p510 should be copied to cell n5
If D9 is a 2, then range q5:q15 should be copied to cell n5
N5 is the beginning of a designated range for a combo box (form control) and I would like this items within the combo box to automatically update based on the value in D9.
So, I'm having trouble with my code. See below. Any help is appreciated.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim iTarget As Range
iTarget = Range("D9").Value
Application.ScreenUpdating = False
Select Case iTarget
Case 1
Range("P5:P15").Select
Selection.Copy
Range("N5").Select
ActiveSheet.Paste
Range("D3").Activate
Exit Sub
Case 2
Range("Q5:Q15").Select
Selection.Copy
Range("n5").Select
ActiveSheet.Paste
Range("D3").Activate
Exit Sub
End Select
Application.ScreenUpdating = True
End Sub
Any suggestions?
If D9 is a 1, then range p510 should be copied to cell n5
If D9 is a 2, then range q5:q15 should be copied to cell n5
N5 is the beginning of a designated range for a combo box (form control) and I would like this items within the combo box to automatically update based on the value in D9.
So, I'm having trouble with my code. See below. Any help is appreciated.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim iTarget As Range
iTarget = Range("D9").Value
Application.ScreenUpdating = False
Select Case iTarget
Case 1
Range("P5:P15").Select
Selection.Copy
Range("N5").Select
ActiveSheet.Paste
Range("D3").Activate
Exit Sub
Case 2
Range("Q5:Q15").Select
Selection.Copy
Range("n5").Select
ActiveSheet.Paste
Range("D3").Activate
Exit Sub
End Select
Application.ScreenUpdating = True
End Sub
Any suggestions?