I have already working code, but it only works for one person. I need to be able to have many peoples data moved from one sheet to another
Sub button()
With Worksheets("three").Range("G1")
If .Value = "sconlon@iadvancenow.com" Then
Worksheets("Sheet2").Range("C3") = .Offset(0, 1).Value
Worksheets("Sheet2").Range("D3") = .Offset(0, 2).Value
End If
With Worksheets("three").Range("G1")
If .Value = "kedwards@iadvancenow.com" Then
Worksheets("Sheet2").Range("C4") = .Offset(0, 1).Value
Worksheets("Sheet2").Range("D4") = .Offset(0, 2).Value
End If
End With
End Sub
I only get the results from the first person
Your current code should fail to compile with a
Compile error: Expected End With
. You only need 1With
statement for what you're trying to do. Additionally, utilizeIf/ElseIf
in this scenario:However, I'm not sure what you're trying to accomplish - right now you're only looking at cell
G1
- how is your data setup? You'd have to include more details for us to help you.