Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
mikeburg
 
Posts: n/a
Default How to skip cells with text strings.


What should I add to the code below to cause it to skip a cell that
contains a text string in the cell above it? I need it to only work on
numbers in the cell above it.

If ActiveCell.Offset(rowoffset:=-1) < "" Then
ActiveCell = ActiveCell.Offset(rowoffset:=-1) + 1
Application.SendKeys ("{Enter}")
End If

Thanks so much.

mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=393456

  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

You can check the cell above by:

if isnumeric(activecell.offset(-1,0)) then
'it's numeric.
else
'it's not
end if

mikeburg wrote:

What should I add to the code below to cause it to skip a cell that
contains a text string in the cell above it? I need it to only work on
numbers in the cell above it.

If ActiveCell.Offset(rowoffset:=-1) < "" Then
ActiveCell = ActiveCell.Offset(rowoffset:=-1) + 1
Application.SendKeys ("{Enter}")
End If

Thanks so much.

mikeburg

--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=393456


--

Dave Peterson
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
text wrap in merged cells SteveFerd Excel Discussion (Misc queries) 3 July 16th 05 12:46 PM
format cells having text steve Excel Discussion (Misc queries) 2 July 15th 05 01:24 AM
Referencing cells text output if it meets specific conditions Chersie Excel Worksheet Functions 3 April 18th 05 04:34 PM
Adding two text cells together Audrey Excel Discussion (Misc queries) 4 February 24th 05 09:57 PM
how do i add the same text after current text in multiple cells Sue Excel Discussion (Misc queries) 3 January 13th 05 09:28 PM


All times are GMT +1. The time now is 06:17 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"