Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() I have 4000 rows of data with numbers in it (only one column...column C). These numbers are consecutive but these have breaks in between. So I am trying to find out where those breaks are and output those points in a list. So here is a macro that I came up with...but these array doesn't seem to write out results.... can anybody help please? This macro tries to compare the two adjacent cells and if the difference between the values is greater than 1 then it copies that value in an array and writes that value in a cell in the same sheet. I am no expert by any means. Please help! Sub Macro1() Dim temp(1, 1000) As Integer i = 0 previouscell = 0 For Each cell In Range("C:C") currentcell = cell.Value abc = previouscell + 1 If currentcell < abc Then temp(1, i) = currentcell i = i + 1 Range("D" & i).Value = temp(1, i) End If previouscell = cell.Value Next cell End Sub Thanks, Jay -- sa02000 ------------------------------------------------------------------------ sa02000's Profile: http://www.excelforum.com/member.php...o&userid=27747 View this thread: http://www.excelforum.com/showthread...hreadid=569539 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Display an array of references | Excel Worksheet Functions | |||
Transpose words and numbers into array of different proportions | Excel Discussion (Misc queries) | |||
Return Array with Array | Excel Worksheet Functions | |||
Formula to list unique values | Excel Worksheet Functions | |||
VBA Import of text file & Array parsing of that data | Excel Discussion (Misc queries) |