Get Data to Populate from one Worksheet to Another, Based on data entered

marshak

Board Regular
Joined
May 28, 2007
Messages
65
Hello all! Please help!

The following shows my table in Sheet 1. When I enter "Y" into any cell under Column G (Key Event?) (Sheet1), I need the row to automatically populate in another worksheet called Key Events.

(...and if possible, delete the row from the Key Events worksheet if "Y" is replaced with "N" in Sheet 1) -- if this is not an easy task, then please just focus on the initial task above.

Thank you so much!!

100478__130644324v1_CF Chronology.xlsx
ABCDEFG
1DateEventSourceDesignationPrimary RelevanceSecondary RelevanceKey Event?
21995Event 1Source 1Caputo
31994-1997Event 2Source 2Caputo
41997-2002Event 3Source 3Caputo
5June 1997-Dec. 2002Event 4Source 4Caputo
62000Event 5Source 5USRC BackgroundCaputo
72002Event 6Source 6Caputo
88/27/2003Event 7Source 7Dorsey ConnectionsCaputo
91/22/2007Event 8Source 8Dorsey Connections
105/30/2007Event 9Source 9Dorsey Connections
116/22/2007Event 10Source 10Dorsey Connections
127/17/2008Event 11Source 11Dorsey Connections
Master Chron (2)
Cells with Data Validation
CellAllowCriteria
F6:F12List=Relevance_List
D6:D12List=Designation_List
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Hello Marshak,

The following event code placed into the Sheet1 module should do the task for you:-

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

    If Intersect(Target, Columns(7)) Is Nothing Then Exit Sub
    If Target.Count > 1 Then Exit Sub
    If Target.Value = vbNullString Then Exit Sub
    
    Application.ScreenUpdating = True
    
    If Target.Value = "Y" Then
            Target.EntireRow.Copy Sheets("Key Events").Range("A" & Rows.Count).End(3)(2)
            ElseIf Target.Value = "N" Then
            Target.EntireRow.Delete
    End If
    
    Sheets("Key Events").Columns.AutoFit
    Application.ScreenUpdating = True

End Sub

I hope that this helps.

Cheerio,
vcoolio.
 
Upvote 0
Hello Marshak,

The following event code placed into the Sheet1 module should do the task for you:-

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

    If Intersect(Target, Columns(7)) Is Nothing Then Exit Sub
    If Target.Count > 1 Then Exit Sub
    If Target.Value = vbNullString Then Exit Sub
   
    Application.ScreenUpdating = True
   
    If Target.Value = "Y" Then
            Target.EntireRow.Copy Sheets("Key Events").Range("A" & Rows.Count).End(3)(2)
            ElseIf Target.Value = "N" Then
            Target.EntireRow.Delete
    End If
   
    Sheets("Key Events").Columns.AutoFit
    Application.ScreenUpdating = True

End Sub

I hope that this helps.

Cheerio,
vcoolio.

THANK YOU SO VERY MUCH!!
 
Upvote 0
You're welcome Marshak. I'm glad to have been able to assist.

Cheerio,
vcoolio.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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