Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Enter text in a cell to return a text value in same cell Danno 24/7[_2_] Excel Discussion (Misc queries) 6 May 9th 08 06:26 AM
Find text in a cell and copy text to another cell Shaun Excel Discussion (Misc queries) 6 July 4th 07 05:25 PM
Copy text from cell to cell with one cell changing text Bobby Excel Worksheet Functions 5 March 15th 07 11:09 PM
Deleting Rows based on text in cell & formatting cell based on text in column beside it Steve Excel Programming 4 February 26th 04 03:31 PM
extracting text from within a cell - 'text to rows@ equivalent of 'text to columns' Dan E[_2_] Excel Programming 4 July 30th 03 06:43 PM


All times are GMT +1. The time now is 03:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"