I am asking what might be a basic question for Excel / VBA, but I am trying to copy rows from one worksheet (StrategicPlanning) to another worksheet (Experiment) based on what is selected in E7 of Worksheet Experiment. How the Experiment worksheet looks -- please ignore the other cells
My code is not working, and I have a feeling I'm either missing something obvious or I am on the wrong path entirely.
a = Worksheets("StrategicPlanning").Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To a
If Worksheets("StrategicPlanning").Cells(i, 5).Value = Worksheets("Experiment").Cells(7, 5) Then
Worksheets("StrategicPlanning").Rows(i).Copy
Worksheets("Experiment").Activate
b = Worksheets("Experiment").Cells(b + 1, 1).Select
ActiveSheet.Paste
Worksheets("StrategicPlanning").Activate
End If
Next
End Sub
I appreciate any and all help! Many thanks!