Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Formulas are skipping a row

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
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
reference row on another sheet skipping zeros but not skipping li. Brennan Downes Excel Discussion (Misc queries) 2 April 2nd 23 01:28 PM
Skipping rows Rob Excel Worksheet Functions 1 March 4th 10 04:52 PM
Formulas - Skipping Cells Skipping Cells Excel Discussion (Misc queries) 1 March 24th 08 06:51 PM
Skipping Blanks (Again) F. Lawrence Kulchar Excel Discussion (Misc queries) 3 March 7th 08 10:43 PM
skipping every second cell DDOUBLEU Excel Worksheet Functions 2 November 9th 05 03:00 PM


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