Consulting

Results 1 to 3 of 3

Thread: Solved: if column B is empy delete the data on column A

  1. #1
    VBAX Mentor
    Joined
    Feb 2012
    Posts
    406
    Location

    Question Solved: if column B is empy delete the data on column A

    Hello to all .

    I have a request , I need a VBA code that if column B is empty , delete the data on column A on that row , just I do not want to delete the row .

    Please help me on this subject .

    Thank you very much .

  2. #2
    VBAX Contributor GarysStudent's Avatar
    Joined
    Aug 2012
    Location
    Lakehurst, NJ, USA
    Posts
    127
    Location
    Perhaps:

    [VBA]

    Sub ClearA()
    Dim r As Range
    For Each r In Intersect(Range("B:B"), ActiveSheet.UsedRange)
    If IsEmpty(r) Then
    r.Offset(0, -1).Clear
    End If
    Next
    End Sub

    [/VBA]

  3. #3
    VBAX Mentor
    Joined
    Feb 2012
    Posts
    406
    Location
    Thank you very much .

Posting Permissions

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