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

    REPLACE 'C' (2000 sr 1)

    i have this sheet, my problem is to replace with "C" in column where you see in every column P=ANNO a blank cell but is present a data in column DAL

    For example in line 12 is present in G12 a DATE insert in F12 "C"

    in line 12 is present in K12 a DATE insert in J12 "C"

    ...

    In effect where is present a date without "P" replace "C"..

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: REPLACE 'C' (2000 sr 1)

    You could use autofilter to filter column g for "non-blanks" and then filter on column F for blanks

    Then fill in "C" in the first cell, copy it, select all the other "visible cells" and paste it.

    Steve

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

    Re: REPLACE 'C' (2000 sr 1)

    One problem is that your blank cells are not blank - they contain a space.

    The following macro may do what you want. Make a backup copy of the workbook before trying it!

    Sub InsertC()
    Dim lngRow As Long
    Dim lngCol As Long
    For lngCol = 6 To 130 Step 4
    For lngRow = 5 To Cells(65536, lngCol).End(xlUp).Row
    If Trim(Cells(lngRow, lngCol)) = "" And Trim(Cells(lngRow, lngCol + 1)) <> "" Then
    Cells(lngRow, lngCol) = "C"
    End If
    Next lngRow
    Next lngCol
    End Sub

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

    Re: REPLACE 'C' (2000 sr 1)

    NOT IMPORTATNT "Make a backup copy of the workbook before trying it!"....
    THE CODE IS MAKED FROM THE WIZARD HANSV (i am always sure)


    The code work to the first test...

    Tks HansV

Posting Permissions

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