Macros for data transfer - one sheet to another

Jackie90

New Member
Joined
May 12, 2011
Messages
1
Macros for data transfer - one sheet to another
<hr style="color:#ebebeb; background-color:#ebebeb" size="1"> Hello All,

I hope everyone is having a good day, mine has been just dreadful because I have this Excel sheet I just can't figure out and my boss is giving me a hard time. If you could help me, I'd appreciate it a lot. I've been working on this for the past two days and truly have no idea where to start. It even took me 15 minutes to figure out how to post on here. ;)


Right now I have one Master sheet called, 'Potentials'. I need this data to transfer into either the 'Engagement' or 'Out' sheet depending on what I write in the 'Response' column in the master sheet.

If I write, 'Out' in the 'Response' column of the master sheet, I want all the information in that row to be cut from the master sheet and transferred into the 'Out' Sheet.

If I write 'NDA' in the Response column of the master sheet, I want all the information in that row to be transferred to the 'Engagement' sheet and cut from the master sheet. However, this is the tricky part, once it is transferred to the 'Engagement' sheet, I need it to be cut and transferred to the 'Out' sheet if I write 'Out' in the Response column.

And I have one last request!!!
smile.gif
On all the sheets there is a column entitled, 'Last Date of Contact', I need all the sheets to always be sorted by date, the oldest date should always be on the top. (For example, 02/15/2011 should be above 03/20/2011 )


I truly will be grateful to anyone who can offer me assistance. I just hope this can be resolved, I really am on edge about it. :confused:




If you can help me, please let me know! I can email you the excel sheet that is giving me such grief! I really am terrible with these computers.:mad:


 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Macros for data transfer - one sheet to another
<hr style="color:#ebebeb; background-color:#ebebeb" size="1"> Hello All,

I hope everyone is having a good day, mine has been just dreadful because I have this Excel sheet I just can't figure out and my boss is giving me a hard time. If you could help me, I'd appreciate it a lot. I've been working on this for the past two days and truly have no idea where to start. It even took me 15 minutes to figure out how to post on here. ;)


Right now I have one Master sheet called, 'Potentials'. I need this data to transfer into either the 'Engagement' or 'Out' sheet depending on what I write in the 'Response' column in the master sheet.

If I write, 'Out' in the 'Response' column of the master sheet, I want all the information in that row to be cut from the master sheet and transferred into the 'Out' Sheet.

If I write 'NDA' in the Response column of the master sheet, I want all the information in that row to be transferred to the 'Engagement' sheet and cut from the master sheet. However, this is the tricky part, once it is transferred to the 'Engagement' sheet, I need it to be cut and transferred to the 'Out' sheet if I write 'Out' in the Response column.

And I have one last request!!!
smile.gif
On all the sheets there is a column entitled, 'Last Date of Contact', I need all the sheets to always be sorted by date, the oldest date should always be on the top. (For example, 02/15/2011 should be above 03/20/2011 )


I truly will be grateful to anyone who can offer me assistance. I just hope this can be resolved, I really am on edge about it. :confused:




If you can help me, please let me know! I can email you the excel sheet that is giving me such grief! I really am terrible with these computers.:mad:



There are probably much better ways, however, these may help or get you started?

Code:
Sub Jackie90()
'This assumes that Column D is the Response Column and Column E is the Last Date of Contact
'With this you have too Run the macro after you make entry.
Dim lrPo As Long
Dim lrEn As Long
Dim lrOu As Long
Dim i As Long

lrPo = Sheets("Potentials").Cells(Rows.Count, 1).End(3).Row
lrEn = Sheets("Engagement").Cells(Rows.Count, 1).End(3).Row
lrOu = Sheets("Out").Cells(Rows.Count, 1).End(3).Row

With Sheets("Potentials")

    For i = lrPo To 2 Step -1
    
        If Range("D" & i).Value = "OUT" Then
            Sheets("Out").Range("A2").EntireRow.Insert shift:=xlDown
            Range("D" & i).EntireRow.Cut Sheets("Out").Range("A2")
        End If

        If Range("D" & i).Value = "NDA" Then
            Sheets("Engagement").Range("A2").EntireRow.Insert shift:=xlDown
            Range("D" & i).EntireRow.Cut Sheets("Engagement").Range("A2")
        End If

    Next i
    
End With

With Sheets("Potentials")

    Rows("2:" & lrPo).Select
    Selection.Sort Key1:=Range("E2"), Order1:=xlAscending, Header:=xlGuess, _
        OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
        DataOption1:=xlSortNormal
    
End With

With Sheets("Out")

    Rows("2:" & lrOu).Select
    Selection.Sort Key1:=Range("E2"), Order1:=xlAscending, Header:=xlGuess, _
        OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
        DataOption1:=xlSortNormal

End With

With Sheets("Engagement")

    Rows("2:" & lrEn).Select
    Selection.Sort Key1:=Range("E2"), Order1:=xlAscending, Header:=xlGuess, _
        OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
        DataOption1:=xlSortNormal

End With


End Sub
Sub Jackie90Two()
'This assumes that Column D is the Response Column and Column E is the Last Date of Contact
'With this you have too Run the macro after you make entry.
Dim lrEn As Long
Dim lrOu As Long
Dim i As Long

lrEn = Sheets("Engagement").Cells(Rows.Count, 1).End(3).Row
lrOu = Sheets("Out").Cells(Rows.Count, 1).End(3).Row

With Sheets("Engagement")

    For i = lrEn To 2 Step -1
    
        If Range("D" & i).Value = "OUT" Then
            Sheets("Out").Range("A2").EntireRow.Insert shift:=xlDown
            Range("D" & i).EntireRow.Cut Sheets("Out").Range("A2")
        End If

    Next i
    
End With

With Sheets("Out")

    Rows("2:" & lrOu).Select
    Selection.Sort Key1:=Range("E2"), Order1:=xlAscending, Header:=xlGuess, _
        OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
        DataOption1:=xlSortNormal

End With

With Sheets("Engagement")

    Rows("2:" & lrEn).Select
    Selection.Sort Key1:=Range("E2"), Order1:=xlAscending, Header:=xlGuess, _
        OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
        DataOption1:=xlSortNormal

End With


End Sub
 
Upvote 0

Forum statistics

Threads
1,224,541
Messages
6,179,418
Members
452,912
Latest member
alicemil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top