It's been a few years since VBA class so please respond as if you were writing in an "Excel VBA for Dummies" book.
In column G, each cell in range G2:G1001 is an individual data validation drop down list of all the worksheets in my workbook. I have a macro that when you select "Questar" from the dropdown in cell "G2", it copies cells A2:F2 and pastes them to the worksheet titled "Questar" in the first empty row. That all works fine.
However, my issue is it only works in cell G2. I have data in rows 2-1001 and I need this to work for all cells G2:G1001. Here is what I have so far and works for cell "G2":
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;">Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("G2:G1001")) Is Nothing Then
Select Case Range("G2")
Case "Questar": Questar
End Select
End If
End Sub</code>I think that the Select Case Range("G2") needs to change but I have tried everything. I will eventually add more cases but I want to get one worksheet working correctly before adding more cases and macros. Any suggestions? Please let me know if more information is needed.
In column G, each cell in range G2:G1001 is an individual data validation drop down list of all the worksheets in my workbook. I have a macro that when you select "Questar" from the dropdown in cell "G2", it copies cells A2:F2 and pastes them to the worksheet titled "Questar" in the first empty row. That all works fine.
However, my issue is it only works in cell G2. I have data in rows 2-1001 and I need this to work for all cells G2:G1001. Here is what I have so far and works for cell "G2":
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;">Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("G2:G1001")) Is Nothing Then
Select Case Range("G2")
Case "Questar": Questar
End Select
End If
End Sub</code>I think that the Select Case Range("G2") needs to change but I have tried everything. I will eventually add more cases but I want to get one worksheet working correctly before adding more cases and macros. Any suggestions? Please let me know if more information is needed.