• fit to the left (2000)

    Author
    Topic
    #403902

    I have this file and my problem is to fit and arrange to left all block of date with no blank cell
    Sheet INITIAL is the the original and sheet FINAl is the result
    In effect is a diffrence from a date and your total

    T/C is a type
    FROM is the start date
    TO teh final date
    T the difference

    Always is present a block with 4 cells.

    The possible range of this F4:AG2500

    Viewing 0 reply threads
    Author
    Replies
    • #817559

      Hello Salvatore,

      Try this macro:

      Sub FitToLeft()
      Dim wsh As Worksheet
      Dim lngRow As Long
      Dim lngCol As Long
      Dim lngLastRow As Long

      Set wsh = Worksheets(“INITIAL”)
      lngLastRow = wsh.Range(“A65536”).End(xlUp).Row
      For lngRow = 4 To lngLastRow
      For lngCol = 33 To 6 Step -1 ‘ F to AG backwards
      If wsh.Cells(lngRow, lngCol) = “” Then
      wsh.Cells(lngRow, lngCol).Delete Shift:=xlShiftToLeft
      End If
      Next lngCol
      Next lngRow
      Set wsh = Nothing
      End Sub

      Be sure to test it on a copy of your workbook first!

      • #817700

        very, very fine, it work fine is just that i want!
        Tks.

      • #817701

        very, very fine, it work fine is just that i want!
        Tks.

    Viewing 0 reply threads
    Reply To: fit to the left (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: