Consulting

Results 1 to 3 of 3

Thread: clear contents formula

  1. #1
    VBAX Newbie
    Joined
    Oct 2010
    Posts
    3
    Location

    clear contents formula

    hi i have the below formula which looks at column AU and if it has a value then deleted contents of AQ and AR, but it works only for row 4.

    If Target.AddressLocal = Range("AU4").AddressLocal Then
    Range("AQ4:AR4").ClearContents
    End If

    How can I apply this to all rows below 4 aswell?

    thanks

  2. #2
    VBAX Regular
    Joined
    Oct 2010
    Posts
    73
    Location
    Hi,

    You will need to get the last row of data in order to do what you want.

    Dim Lrow as Long
    Lrow = Sheets("Your Sheet name").Range("AR65536").End(XLUP).Row
    If Target.AddressLocal = Range("AU4").AddressLocal Then
    Range("AQ4:AR" & Lrow).ClearContents
    End If
    My Time is valuable. The forum's time is valuable.
    So take time to say "Thanks"

    As with all programs there may be an easier way!
    CharlesH

  3. #3
    Ah great. Thanks

Posting Permissions

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