+ Reply to Thread
Results 1 to 13 of 13

Generate report based on list of data Validation.

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    906

    Generate report based on list of data Validation.

    Hello,

    If we select the below list and hit the generate the report on other sheet. it will extract the data based on the below list.


    Signed Provider
    Not Signed Provider
    CCHI Expired

    Example: If i select signed provider it will extract all the signed provider based on column AS & AU.

    Thanks in advance
    Best Regards.
    Attached Files Attached Files
    Last edited by hecgroups; 01-24-2012 at 12:27 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    906

    Re: Generate report based on list of data Validation.

    No one have replied. Please any one can help me.

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Generate report based on list of data Validation.

    How do we segregate which rows belong to which group in the list? Is there some field?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  4. #4
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    906

    Re: Generate report based on list of data Validation.

    if you see the sheet their is column for signed contract (AH Column) and for CCHI their is status Valid or Expired in column AV. Based on these column the report should generate when i click on button.

  5. #5
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    906

    Re: Generate report based on list of data Validation.

    no response from any one.

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Generate report based on list of data Validation.

    Will have something ready for you in the morning.

  7. #7
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    906

    Re: Generate report based on list of data Validation.

    thanks for response i am waiting for your help

  8. #8
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    906

    Re: Generate report based on list of data Validation.

    no reply uptill now.

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Generate report based on list of data Validation.

    Sorry, i was travelling so couldnt work out a solution. Will do something shortly.

  10. #10
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Generate report based on list of data Validation.

    Just to clarify- for SIgned it would be the entries in column AH, for expired, AV column = expired. What about unsigned? Would it be AH column where value is 0?

  11. #11
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    906

    Re: Generate report based on list of data Validation.

    It will be in the same column.

    AH column has the following

    - Signed
    - Not Signed
    -Follow-Up

    AV column will have Expired/Valid

  12. #12
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Generate report based on list of data Validation.

    Right click on your 2nd sheet - Report selection and select "View Code". Copy the below code there.
    Option Explicit
    Dim lrow As Long
    Dim i As Long
    
    Private Sub CommandButton1_Click()
    
    Application.ScreenUpdating = False
    
    lrow = Worksheets("Database").Range("A" & Rows.Count).End(xlUp).Row
    
    Select Case Worksheets("Report Selection").Range("B7").Value
    
    Case "Signed Provider"
        Call Signed_P
    Case "Not Signed Provider"
        Call Unsigned_P
    Case "CCHI Expired"
        Call Expired
    End Select
    
    Worksheets("Report Result").Cells.EntireColumn.AutoFit
    
    Worksheets("Report Result").Range("A2").Value = 1
    
    Application.ScreenUpdating = True
    
    End Sub
    
    Sub Signed_P()
        Worksheets("Report Result").Cells.Delete
        Worksheets("Database").Rows("1:1").Copy Worksheets("Report Result").Range("A1")
        For i = 2 To lrow
            If Worksheets("Database").Range("AH" & i).Value = "1" Then
                Worksheets("Database").Rows(i & ":" & i).Copy Worksheets("Report Result").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
            End If
        Next i
    End Sub
    
    Sub Unsigned_P()
        Worksheets("Report Result").Cells.Delete
        Worksheets("Database").Rows("1:1").Copy Worksheets("Report Result").Range("A1")
        For i = 2 To lrow
            If Worksheets("Database").Range("AH" & i).Value = "2" Then
                Worksheets("Database").Rows(i & ":" & i).Copy Worksheets("Report Result").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
            End If
        Next i
    End Sub
    
    Sub Expired()
        Worksheets("Report Result").Cells.Delete
        Worksheets("Database").Rows("1:1").Copy Worksheets("Report Result").Range("A1")
        For i = 2 To lrow
            If Worksheets("Database").Range("AV" & i).Value = "Expired" Then
                Worksheets("Database").Rows(i & ":" & i).Copy Worksheets("Report Result").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
            End If
        Next i
    End Sub
    Once you select the value in the dropdown and click on the button, your data will be refreshed in "Report Result".

  13. #13
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    906

    Re: Generate report based on list of data Validation.

    Thanks boss it work for me.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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