+ Reply to Thread
Results 1 to 4 of 4

If cell is text, then

  1. #1
    achidsey
    Guest

    If cell is text, then


    Excel Experts

    I am writing a autosum procedure. As part of the code I want to choose the
    first cell in a column that contains a number. I use .End(xlUp) to get to
    the top cell.

    But how do I go down one cell if the top cell is text (a column heading).

    I tried

    If IsText(Selection) = True Then
    Selection.Offset(1)
    End If

    But IsText only works as a worksheet function I think.

    What code would I use to say: If this cell is text, go down one cell??

    Thanks,

    Alan


    --
    achidsey

  2. #2
    Chris Marlow
    Guest

    RE: If cell is text, then

    Hi,

    Try Not IsNumeric(x).

    Regards,

    Chris.

    --
    Chris Marlow
    MCSD.NET, Microsoft Office XP Master


    "achidsey" wrote:

    >
    > Excel Experts
    >
    > I am writing a autosum procedure. As part of the code I want to choose the
    > first cell in a column that contains a number. I use .End(xlUp) to get to
    > the top cell.
    >
    > But how do I go down one cell if the top cell is text (a column heading).
    >
    > I tried
    >
    > If IsText(Selection) = True Then
    > Selection.Offset(1)
    > End If
    >
    > But IsText only works as a worksheet function I think.
    >
    > What code would I use to say: If this cell is text, go down one cell??
    >
    > Thanks,
    >
    > Alan
    >
    >
    > --
    > achidsey


  3. #3
    Gary''s Student
    Guest

    RE: If cell is text, then

    Actually you can get to almost all worksheet functions:


    Sub Macro1()
    MsgBox (Application.IsText(Selection))
    End Sub
    --
    Gary''s Student


    "Chris Marlow" wrote:

    > Hi,
    >
    > Try Not IsNumeric(x).
    >
    > Regards,
    >
    > Chris.
    >
    > --
    > Chris Marlow
    > MCSD.NET, Microsoft Office XP Master
    >
    >
    > "achidsey" wrote:
    >
    > >
    > > Excel Experts
    > >
    > > I am writing a autosum procedure. As part of the code I want to choose the
    > > first cell in a column that contains a number. I use .End(xlUp) to get to
    > > the top cell.
    > >
    > > But how do I go down one cell if the top cell is text (a column heading).
    > >
    > > I tried
    > >
    > > If IsText(Selection) = True Then
    > > Selection.Offset(1)
    > > End If
    > >
    > > But IsText only works as a worksheet function I think.
    > >
    > > What code would I use to say: If this cell is text, go down one cell??
    > >
    > > Thanks,
    > >
    > > Alan
    > >
    > >
    > > --
    > > achidsey


  4. #4
    achidsey
    Guest

    RE: If cell is text, then


    That worked. Thanks Chris.

    --
    achidsey


    "Chris Marlow" wrote:

    > Hi,
    >
    > Try Not IsNumeric(x).
    >
    > Regards,
    >
    > Chris.
    >
    > --
    > Chris Marlow
    > MCSD.NET, Microsoft Office XP Master
    >
    >
    > "achidsey" wrote:
    >
    > >
    > > Excel Experts
    > >
    > > I am writing a autosum procedure. As part of the code I want to choose the
    > > first cell in a column that contains a number. I use .End(xlUp) to get to
    > > the top cell.
    > >
    > > But how do I go down one cell if the top cell is text (a column heading).
    > >
    > > I tried
    > >
    > > If IsText(Selection) = True Then
    > > Selection.Offset(1)
    > > End If
    > >
    > > But IsText only works as a worksheet function I think.
    > >
    > > What code would I use to say: If this cell is text, go down one cell??
    > >
    > > Thanks,
    > >
    > > Alan
    > >
    > >
    > > --
    > > achidsey


+ 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