Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I picked up some VBA that inserts a row, then copies the values down from the row above to the new row, then keeps only those values in the new row that contain formulas: Sheets("IDA MI WrkGrp Rpt").Select Range("A13").Select Cells.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _ xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _ False, SearchFormat:=False).Activate ' this finds the first cell in the colum with ' nothing in it. ActiveCell.Offset(-1).Activate - this moves me up one, to the last cell with an entry. ActiveCell.Offset(1).EntireRow.Insert ActiveCell.EntireRow.Copy ActiveCell.Offset(1).EntireRow On Error Resume Next ActiveCell.Offset(1).EntireRow.SpecialCells(xlCons tants).ClearContents On Error GoTo 0 I modied it slightly to ignore errors coming from the ClearContents when it finds no constants on that line. Here is my problem. While it inserts the row, then keeps only cells with formulas, not all of the formulas contain the values I expect. For instance, where a cell copied down contains =(SUM(B$14:B15)-SUM(D$14:D15)), the cell below it now has =(SUM(B$14:B16)-SUM(D$14:D16)), which is correct. But for a cell that contains =Receipt!B5, the cell below it has =Receipt!B7. Why did it not contain =Receipt!B6? Why did it skip a number? Very strange. Thanks for reading. Carroll Rinehart |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
reference row on another sheet skipping zeros but not skipping li. | Excel Discussion (Misc queries) | |||
Skipping rows | Excel Worksheet Functions | |||
Formulas - Skipping Cells | Excel Discussion (Misc queries) | |||
Skipping Blanks (Again) | Excel Discussion (Misc queries) | |||
skipping every second cell | Excel Worksheet Functions |