Error when deleting rows.

Ian Fraser

New Member
Joined
Apr 18, 2002
Messages
1
I have a spreadsheet in which each row has some home brewed functions and each row is identical. A formula in one cell refers to to a cell in the row above.

I am trying to create a macro which will simplify the process of deleting a row, as when I delete a row, the formula (in the row below) produces an @REF! error as the row above is no longer there. That is OK as I can copy the formula from another cell and paste it in.

So this is the problem: When I create the macro it works fine, however, when I run it it produces the @REF! error. I tried tracking down the problem by stepping through the macro, and what appears to be happening is that the macro, after deleting the row, jumps to the functions, runs through them all, goes to back to the top of the functions and stops before copying and pasting the formula.

The macro works fine on a spreadsheet with no functions. I have tried many things, such as deleting the functions from the rows I am trying to remove, but with no success. At this point I am spinning my wheels and would be extremely grateful for any clues as to the solution,

Thanks,

Ian Fraser
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Maybe you could disable calculation at the beginning of you macro as such:<pre>
ActiveSheet.Calculate = False</pre>

Then re-enable calculation at the end of your macro as such:<pre>
ActiveSheet.Calculate = True</pre>

Tom

P.S.

You may as well disable events too!<pre>
Application.EnableEvents = False</pre>

Don't forget to re-enable at the end of your procedure...<pre>
Application.EnableEvents = True</pre>
This message was edited by TsTom on 2002-04-28 08:24
 
Upvote 0

Forum statistics

Threads
1,214,601
Messages
6,120,462
Members
448,965
Latest member
grijken

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top