Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Debbie,
If you don't mind doing a sort on the range, maybe something like this? Sub CallTheProcedure() Call FindGaps(Range("A1:A13")) End Sub Sub FindGaps(rng As Range) Dim c As Range Dim lngCounter As Long rng.Sort Key1:=rng(1, 1) lngCounter = rng(1, 1).Value For Each c In rng If c.Value < lngCounter Then c.Offset(0, 0).Resize(1, 2).Insert _ (xlShiftDown) c.Offset(-1, 0).Value = lngCounter End If lngCounter = lngCounter + 1 Next c Set c = Nothing End Sub -- HTH, Dianne Butterworth Here is a portion of my data set. A B 244 2 243 2 241 2 240 3 239 1 238 1 235 4 233 5 232 5 226 3 225 3 224 3 223 2 How can I find the missing values in the serial list in Column A and insert a row (and the missing value) where appropriate? Thanks Debbie --- Message posted from http://www.ExcelForum.com/ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Insert Name missing from Toolbar | Excel Discussion (Misc queries) | |||
How to find missing values while reconciling files? | Excel Discussion (Misc queries) | |||
Find missing values in a series | Excel Worksheet Functions | |||
insert row into worksheet when date missing | Excel Worksheet Functions | |||
Excel Compare values in columns & display missing values in a new | Excel Discussion (Misc queries) |