I would appreciate some help, if someone has the time!- Moving rows to different worksheets.

tjduff

New Member
Joined
Apr 25, 2014
Messages
6
I would appreciate some help, if someone has the time!

I have an excel workbook that has three different tabs, tab1= repairs tab2=completed repairs tab3= follow up; all tabs have the same column headings A:K. In column "K", I have a data validation to determine the status on the repair, "C,F". All repairs initially start off in the Repairs Tab. At some point, they will be given validation in column "K". I have been trying to encode an action to send the entire row to the the corresponding Tab, C = "Completed repairs" tab and F= "follow up" Tab, once the Validation has been chosen. I appreciate all of your time and thoughts. I feel like the answer is right in front of me but for some reason i am not connecting the dots.

TJ
 

Some videos you may like

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

GrilledCheese

Board Regular
Joined
Apr 23, 2014
Messages
75
Just a FYI, there are many posts in here and online about copying rows from different worksheets to a new worksheet.
 

tjduff

New Member
Joined
Apr 25, 2014
Messages
6
I noticed them but I have not found one that has answered my question. I took a class about 4 years ago, and unfortunately, have not used it since.
as for what I have already:

Sub MoveDataToNewSheet()
Dim R As Range, c As Range, Lr As Long, sh1 As Worksheet, sh2 As Worksheet, vA As Variant
Set sh1 = Sheets("Repairs")
Set sh2 = Sheets("Completed Repairs")
Set R = sh1.Range("A3:K82").CurrentRegion
Lr = 1
For Each c In Intersect(R, sh1.Columns("K"))
If c.Value = 2 Then 'Change value to suit
vA = R.Rows(c.Row).Value
Range(sh2.Cells(Lr, "A"), sh2.Cells(Lr, UBound(vA, 2))).Value = vA
Lr = sh2.Cells(Rows.Count, "A").End(xlUp).Row + 1
End If
Next c
End Sub

but I am lost on the correct action to to use after declaring my variables. That code was from a previous post already in the forum, and I am currently attempting to make it work for me.
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,090,486
Messages
5,414,821
Members
403,546
Latest member
robfraley80

This Week's Hot Topics

Top