Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Enter text in a cell to return a text value in same cell | Excel Discussion (Misc queries) | |||
Find text in a cell and copy text to another cell | Excel Discussion (Misc queries) | |||
Copy text from cell to cell with one cell changing text | Excel Worksheet Functions | |||
Deleting Rows based on text in cell & formatting cell based on text in column beside it | Excel Programming | |||
extracting text from within a cell - 'text to rows@ equivalent of 'text to columns' | Excel Programming |