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

    fit to the left (2000)

    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

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

    Re: fit to the left (2000)

    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!

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

    Re: fit to the left (2000)

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

Posting Permissions

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