I really need it to get a combined code to two sets of values, all have the same columns to copy from but when copying to deposit the values of "RLCMO", Or "RPCMO" Or "RLCMOEC" Or "RPCMOEC" to place the value of columns “U”, “X”, and “AA” into Deposit Column “E”. Copy columns “U”, “X”, and “AA” into Deposit Column “D” for column “K” values of "RLDMO", "RLNDMO", "RLDMOEC", "RLNDMOEC", "RPDMO”, RPNDMO”, ‘RPDMOEC", "RPNDMOEC”. I am not sure how to do it so I was trying to get the first part to run in a code then I could change the appropriate columns to run the other set of values. Data in columns “I” on Sign to “A” on Deposit, “COMPLETED – TRACS” on Deposit “B”, “J” on Sign to Deposit “C”, “S” on Sign to Deposit “” F” and “T” on Sign to Deposit “G” on the first run. The second time through if there is data in column “Y” the copy cells are the same for the first three copying and only the Sign cells change to Cells “V” and “W” for Deposit columns “V” and “W” to Deposit columns “F” and “G” and on third run Sign columns are “Y” and “Z” to Deposit columns “F” and “G”. Sign columns “U”, “X” and “AA” to Deposit column “E”.
I have tried to get a for next loop to work by itself but can’t get it to work. I also tired this code but the statement of checking the last row on Sign
And stopping it if it is equal to or larger that the last row in use on sign. I have stepped through it and on the first time it hits but it just shows that Kcol is 5 and LastRow is 22 then exits the sub and starts over at the first row again.
This is what I tried without success. I can’t figure out why I can’t get this code working.
All Help is greatly appreciated.Sub Cap_Dep() Dim Deposit As Worksheet: Set Deposit = Worksheets("Deposit") Dim Sign As Worksheet: Set Sign = Worksheets("Sign") Dim Credit As Worksheet: Set Credit = Worksheets("Credit") Dim Directory As Worksheet: Set Directory = Worksheets("Directory") Dim LastRow As Long Dim Kcol As Long Dim Drow As Long Sign.Activate LastRow = Cells(Rows.Count, 1).End(xlUp).Row 'Deposit.Activate Drow = 13 For Kcol = 5 To LastRow GoTo Srns Tsr: Next Kcol Srns: 'If Sign.Range("K" & Kcol).Value = "RLCMO" Or Sign.Range("K" & Kcol).Value = "RPCMO" Or Sign.Range("K" & Kcol).Value = "RLCMOEC" Or Sign.Range("K" & Kcol).Value = "RPCMOEC" Then If Sign.Range("K" & Kcol).Value = "RLCMO" Or Sign.Range("K" & Kcol).Value = "RPCMO" Or Sign.Range("K" & Kcol).Value = "RLCMOEC" Or Sign.Range("K" & Kcol).Value = "RPCMOEC" Then Deposit.Range("A" & Drow).Value = Sign.Range("I" & Kcol).Value Deposit.Range("B" & Drow).Value = "COMPLETED-TRACS" Deposit.Range("C" & Drow).Value = Sign.Range("J" & Kcol).Value Deposit.Range("E" & Drow).Value = Sign.Range("U" & Kcol).Value Deposit.Range("F" & Drow).Value = Sign.Range("S" & Kcol).Value Deposit.Range("G" & Drow).Value = Sign.Range("T" & Kcol).Value If Sign.Range("V" & Kcol).Value = "" Then GoTo Tsub Else Drow = Drow + 1 Deposit.Range("A" & Drow).Value = Sign.Range("I" & Kcol).Value Deposit.Range("B" & Drow).Value = "COMPLETED-TRACS" Deposit.Range("C" & Drow).Value = Sign.Range("J" & Kcol).Value Deposit.Range("E" & Drow).Value = Sign.Range("X" & Kcol).Value Deposit.Range("F" & Drow).Value = Sign.Range("V" & Kcol).Value Deposit.Range("G" & Drow).Value = Sign.Range("W" & Kcol).Value If Sign.Range("Y" & Kcol).Value = "" Then GoTo Tsub Else Drow = Drow + 1 Deposit.Range("A" & Drow).Value = Sign.Range("I" & Kcol).Value Deposit.Range("B" & Drow).Value = "COMPLETED-TRACS" Deposit.Range("C" & Drow).Value = Sign.Range("J" & Kcol).Value Deposit.Range("E" & Drow).Value = Sign.Range("AA" & Kcol).Value Deposit.Range("F" & Drow).Value = Sign.Range("Y" & Kcol).Value Deposit.Range("G" & Drow).Value = Sign.Range("Z" & Kcol).Value Drow = Drow + 1 End If End If End If If Kcol <= LastRow Then Exit Sub Tsub: GoTo Tsr Tstop: End If End Sub
Bookmarks