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

    no flipping... (2000 sr 1)

    make a no flipping curson during the eleboration...

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

    Re: no flipping... (2000 sr 1)

    This is virtually incomprehensible. Can you try again?

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: no flipping... (2000 sr 1)

    ... remeber your code:

    Sub ASS_CONT_A_CDI50()
    Dim lngSourceRow As Long
    Dim lngSourceMaxRow As Long
    Dim lngTargetRow As Long
    Dim wshSource As Worksheet
    Dim wshTarget As Worksheet

    On Error GoTo ErrHandler

    ' Set reference to worksheets
    Set wshSource = Worksheets("L0785_TOTALE")
    Set wshTarget = Worksheets("L0785_CDI_50")
    ' Last row in source sheet
    lngSourceMaxRow = wshSource.Range("A65536").End(xlUp).Row
    ' Last row in target sheet
    lngTargetRow = wshTarget.Range("A65536").End(xlUp).Row
    ' Loop backwards through source rows
    For lngSourceRow = lngSourceMaxRow To 7 Step -1
    ' Test condition
    If wshSource.Range("T" & lngSourceRow) = "ASS. CONT. A CDI 50" Then
    ' Next target row
    lngTargetRow = lngTargetRow + 1
    ' Copy to target sheet
    wshSource.Rows(lngSourceRow).Copy wshTarget.Rows(lngTargetRow)
    ' Delete from source sheet
    wshSource.Rows(lngSourceRow).Delete
    End If
    Next lngSourceRow

    ExitHandler:
    Set wshSource = Nothing
    Set wshTarget = Nothing
    Exit Sub

    ErrHandler:
    MsgBox Err.Description, vbExclamation
    Resume ExitHandler
    End Sub

    ... ok during this macro run, i seen spdeely to move the sheets in question ...

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

    Re: no flipping... (2000 sr 1)

    Still not sure I comprehend, but try this (additions in bold):

    Sub ASS_CONT_A_CDI50()
    Dim lngSourceRow As Long
    ...

    On Error GoTo ErrHandler
    Application.ScreenUpdating = False

    ' Set reference to worksheets
    Set wshSource = Worksheets("L0785_TOTALE")
    ...

    ExitHandler:
    Set wshSource = Nothing
    Set wshTarget = Nothing
    Application.ScreenUpdating = True
    Exit Sub

    ErrHandler:
    MsgBox Err.Description, vbExclamation
    Resume ExitHandler
    End Sub

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: no flipping... (2000 sr 1)

    yes have you comprehend!

    same prob for this code:

    Sub PAGATI()
    Dim n As Integer, pr As Integer, C As Integer, s1 As String, s2 As String
    n = 7 'first row of data on TOTALE sheet
    pr = 7 'first paste row on PAGATI sheet
    C = 1 'which row of 2 contains 36
    s1 = "L0785_TOTALE"
    s2 = "L0785_PAGATI"

    Sheets(s1).Select

    Do Until Cells(n, 1) = ""
    If (Cells(n, 4) = Cells(n + 1, 4)) And Cells(n, 19) <> Cells(n + 1, 19) Then
    If Left(Cells(n, 19), 2) = "36" Then
    C = n
    Else
    If Left(Cells(n + 1, 19), 2) <> "36" Then GoTo 100
    C = n + 1
    End If
    Range(Cells(C, 1), Cells(C, 18)).Copy 'copy 36
    Sheets(s2).Select
    Cells(pr, 1).PasteSpecial xlPasteValues
    pr = pr + 1
    Sheets(s1).Select
    Rows(n & ":" & n + 1).Delete
    Else
    100
    n = n + 1
    End If
    Loop

    End Sub

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

    Re: no flipping... (2000 sr 1)

    Same problem - same solution. You can work it out for yourself.

Posting Permissions

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