Results 1 to 2 of 2
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    code not found value... (2000)

    why the code not intercept the value in column E...
    Admit:
    FOGLIO="LUSTSTP"
    REGIONE="PUGLIA"
    SERV="CO"
    In effect i want to count (and increase NUM_ES_1) based this tree value....

    Sub CONTA_COD_PER_AREA(REGIONE, FOGLIO, SERV)

    Dim COLONNA_TROVATA As Long, RNG As RANGE, NUM_ES_1 As Long
    Dim RCELL

    COLONNA_TROVATA = Application.WorksheetFunction.Match("SERV.", Sheets(FOGLIO).RANGE("A2:Z2"), 0) - 1

    With Worksheets(FOGLIO)
    Set RNG = Sheets(FOGLIO).RANGE(Sheets(FOGLIO).RANGE("Y3"), .Cells(.Cells.Rows.Count, "Y").End(xlUp))
    End With

    NUM_ES_1 = 0

    For Each RCELL In RNG
    If RCELL.Value = REGIONE And RCELL.Offset(21, COLONNA_TROVATA) = SERV Then
    NUM_ES_1 = NUM_ES_1 + 1
    End If
    Next

    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: code not found value... (2000)

    Your code makes no sense to me. What do you want to accomplish?

Posting Permissions

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