Consulting

Results 1 to 3 of 3

Thread: Copy range in new sheet by criteria

  1. #1

    Exclamation Copy range in new sheet by criteria

    Hello forum

    I need your help for a little project.

    I want to copy a range of data in a new sheet using a criteria. First i would like to choose a column, and second the criteria.If criteria in this column is meet , copy all rows in the range that meet that criteria in a new sheet named after the criteria

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Have a look at this question.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3

    Exclamation

    Here a chopped code , but is not working, some help pls
    Sub ANALYSE_LEDGER()
    
    
    Dim X As Integer
          
           Dim cc As String
           Dim c As Range
        Dim lRow As Long
        Dim NewWB As Workbook
        
        
        Application.ScreenUpdating = False
        Set NewWB = Workbooks.Add
        col = Application.InputBox("No colonne?", Type:=1)
        Set champ = Columns(col)
        cc = InputBox(Prompt:="Chose Criteria")
        
        For Each c In champ.SpecialCells(xlCellTypeConstants, 66)
        
          If cell.Value Like "*" & c & "*" Then
          Range(Cells(c.Row, 1), Cells(c.Row, 66)).Copy
                 
                NewWB.Activate
                lRow = lRow + 1
                ActiveSheet.Paste Destination:=Worksheets("Sheet1").Cells(lRow, 1)
              
     End If
    
        Next c
        
        End Sub

Posting Permissions

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