jrwrangler
New Member
- Joined
- Mar 22, 2013
- Messages
- 16
Hello
I have a sheet called lpl data. I need to look over at the cells in column j. If the cell in column j has the words "common stock", then i need to copy that entire row, delete that row, and paste it into another sheet called "______ portfolio". The " _____" will depend on the input provided by the user at the beginning of the macro (already coded that up). Column J is the column to the furthest right in the sheet. The new sheet will start taking this data in cell b3. I need to repeat this process for other values in this column and others so if you could please dumb it all down for me so i could do this on my own, i would really appreciate it. thanks
this is how far i got
Sub Copypaste()
Application.ScreenUpdating = False
lr = Sheet("LPL Data").Range("j" & Rows.Count).End(xlUp).Row
For i = 1 To lr
With Sheet("LPL Data")
If LCase(.Range("j" & i).Value) = "Common Stock" Then
lrr = Sheets("*" & " portfolio").Range("B" & Rows.Count).End(xlUp).Row
Range("J", Selection.End(xlToLeft)).Select
Selection.Copy Sheets("*" & " portfolio").Range("b" & lrr)
End If
End With
Next i
Application.ScreenUpdating = True
I have a sheet called lpl data. I need to look over at the cells in column j. If the cell in column j has the words "common stock", then i need to copy that entire row, delete that row, and paste it into another sheet called "______ portfolio". The " _____" will depend on the input provided by the user at the beginning of the macro (already coded that up). Column J is the column to the furthest right in the sheet. The new sheet will start taking this data in cell b3. I need to repeat this process for other values in this column and others so if you could please dumb it all down for me so i could do this on my own, i would really appreciate it. thanks
this is how far i got
Sub Copypaste()
Application.ScreenUpdating = False
lr = Sheet("LPL Data").Range("j" & Rows.Count).End(xlUp).Row
For i = 1 To lr
With Sheet("LPL Data")
If LCase(.Range("j" & i).Value) = "Common Stock" Then
lrr = Sheets("*" & " portfolio").Range("B" & Rows.Count).End(xlUp).Row
Range("J", Selection.End(xlToLeft)).Select
Selection.Copy Sheets("*" & " portfolio").Range("b" & lrr)
End If
End With
Next i
Application.ScreenUpdating = True