+ Reply to Thread
Results 1 to 6 of 6

Entire row auto copied into another datasheet if a value in a particular cell is 'yes'

  1. #1
    Registered User
    Join Date
    02-19-2013
    Location
    Gütersloh, Germany
    MS-Off Ver
    Excel 2007
    Posts
    3

    Exclamation Entire row auto copied into another datasheet if a value in a particular cell is 'yes'

    Hi,

    I have no idea if this is even possible, but I was wondering how I could ensure that a complete row of information is automatically tranferred into another datasheet, if one of the questions in that row is answered with 'yes'.

    This is with regard to a form that I have set up to enter user registration info, which also involves several approval steps. Included are 4 important questions and there will be 4 seperate approval persons that I will be required to contact if the questions are answered with 'yes'. It would be ideal if the user information is automatically copied into a seperate datasheet that is designed for each particular approver so that they only see the info they are required to check. Is such a function possible within Excel?

    Thanks in advance,
    Nathalie

  2. #2
    Valued Forum Contributor
    Join Date
    09-04-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    463

    Re: Entire row auto copied into another datasheet if a value in a particular cell is 'yes'

    upload a sample workbook...

    Regards
    CA Mahaveer Somani

  3. #3
    Registered User
    Join Date
    02-19-2013
    Location
    Gütersloh, Germany
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Entire row auto copied into another datasheet if a value in a particular cell is 'yes'

    I have now included an attachment. I have only included somw of the questions but there will be more user Info in the actual File. If any ofthe fields are answered with 'yes', I would like that all of the User Information from that one line is automatically transferred into a seperate datasheet.

    Many thanks again.
    Attached Files Attached Files

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Entire row auto copied into another datasheet if a value in a particular cell is 'yes'

    Do right click on sheet tab and paste the below code and KEEP a sheet called Sheet2 for paste.

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  5. #5
    Registered User
    Join Date
    02-19-2013
    Location
    Gütersloh, Germany
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Entire row auto copied into another datasheet if a value in a particular cell is 'yes'

    Thank you!

    I have just tried editing the code but have been unsuccessful. So the scenario is as follows;


    If 'yes' is answered in Column 'L', the information from that entire row should be copied to Datasheet 'Future Approval'
    If 'yes' is answered in column 'O', the information from the entire row should be copied to Datasheet 'Adaptation Tool Approval'
    If 'yes' is answered in column 'Q', the information from that entire row should be copied to Datasheet 'Planning Tool Approval'
    If 'yes' is answered in column 'S', the information from that entire row should be copied to Datasheet 'Copy Approval'

    In each datasheet, the table headers will start at B4 and the data input at B5.

    Thanks in advance.

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Entire row auto copied into another datasheet if a value in a particular cell is 'yes'

    Try this....

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

    If 
    Intersect(TargetRange("L:L,O:O,Q:Q,S:S")) Is Nothing Then Exit Sub
    If Trim(UCase(Target.Value)) <> "YES" Then Exit Sub
    Dim sWs 
    As String

    Application
    .ScreenUpdating False

    Select 
    Case Target.Column
        
    Case Is 12sWs "Future Approval" 'ColumnL = 12
        Case Is = 15: sWs = "Adaptation Tool Approval" '
    ColumnO 15
        
    Case Is 17sWs "Planning Tool Approval" 'ColumnQ = 17
        Case Is = 19: sWs = "Copy Approval" '
    ColumnS 19
    End Select

    Target
    .EntireRow.Copy Sheets(sWs).Cells(Rows.Count"B").End(xlUp).EntireRow(2)

    Application.ScreenUpdating True

    End Sub 

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1