+ Reply to Thread
Results 1 to 2 of 2

how to Detect paragraph in cell in string?

  1. #1
    dm16s
    Guest

    how to Detect paragraph in cell in string?

    I am doing an if then statement. I want to check if a cell has a
    certain contents, but the text in the cell is on 2 seperate lines and
    so the IF statement returns fales and does not clear the cell.

    I export a file to excel and then run the macro to update it. I don't
    want the contents of the cells to be cleared unless it is this text
    that is on 2 lines. The slash in the code is where a paragraph should
    be.

    This is what I have

    If ActiveCell.FormulaR1C1 = "Account Title/Account Name" Then
    ActiveCell.FormulaR1C1 = ""
    Range("F" & MyRow & ":F" & MyRow).Select
    ActiveCell.FormulaR1C1 = ""
    Else
    End If

    Thanks for the help!

    Dave


  2. #2
    Bob Phillips
    Guest

    Re: how to Detect paragraph in cell in string?

    Use

    "Account Title" & Chr(10) & "Account Name"

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "dm16s" <[email protected]> wrote in message
    news:[email protected]...
    > I am doing an if then statement. I want to check if a cell has a
    > certain contents, but the text in the cell is on 2 seperate lines and
    > so the IF statement returns fales and does not clear the cell.
    >
    > I export a file to excel and then run the macro to update it. I don't
    > want the contents of the cells to be cleared unless it is this text
    > that is on 2 lines. The slash in the code is where a paragraph should
    > be.
    >
    > This is what I have
    >
    > If ActiveCell.FormulaR1C1 = "Account Title/Account Name" Then
    > ActiveCell.FormulaR1C1 = ""
    > Range("F" & MyRow & ":F" & MyRow).Select
    > ActiveCell.FormulaR1C1 = ""
    > Else
    > End If
    >
    > Thanks for the help!
    >
    > Dave
    >




+ 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