Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Only need every second number


Here's a quicky simple way just put this together not entirely sure what
your trying to do as zero is counted as anything but the code below will
put the numbers which arent 0 in the column next to it just by simple
offset. I put this in the worksheet code as Activate just so i could
get it to work by clicking another sheet and clicking back but you can
create a keyboard shortcut or Auto_open or whatever you like!

HTH

P.S the last bit of code at the bottom (Cleanup) stick it a module on
its own!
Simon.

Private Sub Worksheet_Activate()
Dim rng As Range
Set rng = Range("A1:A10")
For Each mycell In rng
If mycell = 0 Then
ElseIf mycell < 0 Then
mycell.Offset(0, 1) = mycell.Value
End If
Next
Call Cleanup
End Sub

Sub Cleanup()
Dim rng As Range
Set rng = Range("a1:a10")
For Each mycell In rng
If mycell.Offset(0, 1) = "" Then
mycell.Offset(0, 1).Delete
End If
Next
End Sub


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=474232

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
Sumif number is greater than a number but less than another number lulu151 Excel Discussion (Misc queries) 2 May 7th 10 07:12 PM
How can I click on a telephone number in an Excel 2002 spreadsheet, and have the number dialed? jbclem Excel Discussion (Misc queries) 2 August 13th 09 01:57 AM
How to calculate number of occurencies of a specific number number Stefan Excel Discussion (Misc queries) 4 September 8th 08 08:33 AM
excel format cells/Number/Category: Number problem Matts Excel Discussion (Misc queries) 5 December 9th 04 09:47 PM
Rounding a number to a multiple quantity that adds to a fixed total number wjlo Excel Worksheet Functions 1 November 9th 04 04:43 PM


All times are GMT +1. The time now is 02:39 PM.

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

About Us

"It's about Microsoft Excel"