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

    FILL IF IS BLANK (2000 sr 1)

    in this wbook is present an hide sheet DB AGENZIE.
    My problem, with a macro:
    If in the column L not is present the same value in the colum K copy the value in the cells of column L and fill the cells blank

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

    Re: FILL IF IS BLANK (2000 sr 1)

    Can you give a specific example? There are 65477 blank cells in column L.

  3. #3
    3 Star Lounger
    Join Date
    Feb 2003
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: FILL IF IS BLANK (2000 sr 1)

    Does something like this help

    Option Explicit

    Private Sub FillDates()

    Dim Source as Range
    Dim oCell as Range

    Set Source = Range("L2:L100")
    For each oCell in Source
    If Not IsBlank(oCell) And oCell<>oCell.Offset(-1,0) then
    oCell.Offset(-1,0) =oCell
    End If
    Next

    End Sub

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

    Re: FILL IF IS BLANK (2000 sr 1)

    In effect copy the same value present in K if in L not is prsent...
    In this case from K60 in L60, k61 in L61 ecc....
    Do until the macro find in column K a blank cell...
    During the macro no open the sheet...

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

    Re: FILL IF IS BLANK (2000 sr 1)

    Here is a variation on Paul's code:

    Private Sub FillDates()
    Dim wks As Worksheet
    Dim oCell As Range

    Set wks = Worksheets("DB_AGENZIE")

    For Each oCell In wks.Range(wks.Range("K2"), wks.Range("K65536").End(xlUp))
    If oCell.Offset(0, 1) = "" Then
    oCell.Offset(0, 1) = oCell
    End If
    Next

    Set wks = Nothing
    Set oCell = Nothing
    End Sub

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

    Re: FILL IF IS BLANK (2000 sr 1)

    Tks Hans & Paul, it work...

Posting Permissions

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