+ Reply to Thread
Results 1 to 2 of 2

Clear contents with condition

  1. #1
    Vanna
    Guest

    Clear contents with condition

    Hi everyone,

    I'm a novice user in Excel Macros... still a lot more to be learn.
    I need to write a code to clear cell contents under from column H if the
    cell contains "("

    I used:

    Range = H:H
    For each cell in range
    If substring of cell.value=")" then
    cells.ClearContents
    next

    In advance, thank you for your help.

  2. #2
    Henrich
    Guest

    RE: Clear contents with condition

    Hi, i'm using this (there are other options to do this):

    Sub Clear()
    Row = 1
    Do Until Cells(Row, 8) = ""
    Text = Cells(Row, 8)
    If Text = """(""" Then Cells(Row, 8).ClearContents
    Row = Row + 1
    Loop
    End Sub

    This code is searching for your string until it reach first empty cell in
    column H.

    Henrich

    „Vanna" nap*sal (nap*sala):

    > Hi everyone,
    >
    > I'm a novice user in Excel Macros... still a lot more to be learn.
    > I need to write a code to clear cell contents under from column H if the
    > cell contains "("
    >
    > I used:
    >
    > Range = “H:H”
    > For each cell in range
    > If substring of cell.value=")" then
    > cells.ClearContents
    > next
    >
    > In advance, thank you for your help.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1