Hello,
I am slowly building my knowledge up by trial and error and tons of money on books. However, I cannot seem to figure this out.
I have a workbook with 4 sheets, Home, Team 1, Team 2, and Team 3.
On the Sheet "Home" I have a simple 4 cell system. "C9" is a drop down box with 18 participants' names. "C11" auto-populates with the team the selected person is on by VLOOKUP from a list offscreen. "C13" is a dropdown box with with reasons why they get points. "C15" auto-populates with the points associated with the selected reason.
The submit button runs a macro that will be a long series of If...Then...Else functions (unless someone knows how to better accomplish the task).
What I would like the script to do is: if the participant selected is "Jason" (Team 1) then the cell with the reason will copy the value (worksheets("Home")) and pastespecial to the "Team 1" worksheet in the first available open cell in column E (the first cell pasted to would be the 8th in the column). If "Sam" then the reason would copy and paste to "Team 1" worksheet in the first open cell in column H, starting at H8. If "Chris", then the reason would copy and paste to the "Team 1" worksheet in the first open cell in column K...and so on.
The reason the copy value is because I don't want it to copy the whole dropdown box. The reason for the paste special is beacuse I would like it to paste with the same formatting as the destination cell.
So far the script looks like this:
Sub submit_macro()
Dim LR As Long, i As Long
With Sheets("Home")
LR = .Range("C" & Rows.Count).End(xlUp).Row + 1
For i = 1 To LR
With .Range("C" & i)
If .Value = "Jason" Then
Sheets("Home").Range("C13").Copy Destination:=Sheets("Team 1").Range("E8")
ElseIf .Value = "Sam" Then
Sheets("Home").Range("C13").Copy Destination:=Sheets("Team 1").Range("H8")
ElseIf .Value = "Chris" Then
Sheets("Home").Range("C13").Copy Destination:=Sheets("Team 1").Range("K8")
End If
End With
Next i
End With
End Sub
Some was borrowed. This will be long once it is all entered. It does not currently copy the value or paste special. Instead, it pastes the whole dropdown box and with the source formatting. It also doesn't add the most recent paste to the nect open cell in the column. These are things i would like to correct.
If there are any questions, I would be happy to answer them.
I have pictures but not upload-able it seems.
Thanks in advance for getting all the way through this and for any help you may have to offer.
I am slowly building my knowledge up by trial and error and tons of money on books. However, I cannot seem to figure this out.
I have a workbook with 4 sheets, Home, Team 1, Team 2, and Team 3.
On the Sheet "Home" I have a simple 4 cell system. "C9" is a drop down box with 18 participants' names. "C11" auto-populates with the team the selected person is on by VLOOKUP from a list offscreen. "C13" is a dropdown box with with reasons why they get points. "C15" auto-populates with the points associated with the selected reason.
The submit button runs a macro that will be a long series of If...Then...Else functions (unless someone knows how to better accomplish the task).
What I would like the script to do is: if the participant selected is "Jason" (Team 1) then the cell with the reason will copy the value (worksheets("Home")) and pastespecial to the "Team 1" worksheet in the first available open cell in column E (the first cell pasted to would be the 8th in the column). If "Sam" then the reason would copy and paste to "Team 1" worksheet in the first open cell in column H, starting at H8. If "Chris", then the reason would copy and paste to the "Team 1" worksheet in the first open cell in column K...and so on.
The reason the copy value is because I don't want it to copy the whole dropdown box. The reason for the paste special is beacuse I would like it to paste with the same formatting as the destination cell.
So far the script looks like this:
Sub submit_macro()
Dim LR As Long, i As Long
With Sheets("Home")
LR = .Range("C" & Rows.Count).End(xlUp).Row + 1
For i = 1 To LR
With .Range("C" & i)
If .Value = "Jason" Then
Sheets("Home").Range("C13").Copy Destination:=Sheets("Team 1").Range("E8")
ElseIf .Value = "Sam" Then
Sheets("Home").Range("C13").Copy Destination:=Sheets("Team 1").Range("H8")
ElseIf .Value = "Chris" Then
Sheets("Home").Range("C13").Copy Destination:=Sheets("Team 1").Range("K8")
End If
End With
Next i
End With
End Sub
Some was borrowed. This will be long once it is all entered. It does not currently copy the value or paste special. Instead, it pastes the whole dropdown box and with the source formatting. It also doesn't add the most recent paste to the nect open cell in the column. These are things i would like to correct.
If there are any questions, I would be happy to answer them.
I have pictures but not upload-able it seems.
Thanks in advance for getting all the way through this and for any help you may have to offer.