+ Reply to Thread
Results 1 to 2 of 2

Thread: Chossing data for graph

  1. #1
    Registered User
    Join Date
    06-21-2008
    Posts
    28

    Chossing data for graph

    Helo, I have 11 groups of data containing 3 column and having about 11 line each. I need to select one of these groups of values from a cells range That I definited on my worksheets("Feuil1") as being "Zone".
    I insert here the workbook and also here is my code. I have problem in arranging the data to fit the filter. Once the data are selected I want to be able to have them in three column so that my graph will be build. The graph x-ordonnate is the first column. There are two line, one of them is the second column and the second one his the third column.
    Sub Item()
     Application.ScreenUpdating = False
     Sheets("Feuil2").Range("D4:Z1122").ClearContents
     Worksheets("Feuil2").AutoFilterMode = False
     With Sheets("feuil2")
     .Range("A1:Z1122").AutoFilter Field:=2, Criteria1:=Range("Zone")
    CopyFilter
    
    End With
    
    End Sub
    
    
    Sub CopyFilter()
    'by Tom Ogilvy
    'The following code copies the filtered rows from the active sheet to Sheet2.
    Dim rng As Range
    Dim rng2 As Range
    Sheets("Feuil2").Select
    
    With ActiveSheet.AutoFilter.Range
     On Error Resume Next
       Set rng2 = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _
           .SpecialCells(xlCellTypeVisible)
     On Error GoTo 0
    End With
    If rng2 Is Nothing Then
       MsgBox "No data to copy"
    Else
       Set rng = ActiveSheet.AutoFilter.Range
       rng.Offset(1, 0).Resize(rng.Rows.Count - 1).Copy _
         Destination:=Worksheets("Feuil1").Range("A65536").End(xlUp).Offset(1, 0).Range("A1")
    
    End If
       ActiveSheet.ShowAllData
    
    End Sub
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    06-21-2008
    Posts
    28
    Well I finaly got to make it works.. Just telling that to make sure noone's going to work all night on that to help me..

+ 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.2.0