Determine if formulas were copied down or across

RobExcel

Board Regular
Joined
Jan 6, 2010
Messages
69
I've got a variety of worksheets that are quite large and have formulas that have been copied down and across. The formulas use relative and absolute references, so some of the cell references change; whereas, others do not.

As others work on my files (or I make an error), sometimes a formula gets overwritten in a strange location. For example, if there's a block of formulas in D50:Z2000, the user might try to press Ctrl+C to copy something, but miss the ctrl press and actually enter a C into the cell.

I'd like to have a macro that can be run to produce a check sheet that basically shows if formulas are consistently entered across columns and down rows. An example is at the bottom of this post.

Is there a way to use VBA to determine if the formulas are consistent? The only thing I can think of is to create a dummy worksheet and just enter the formula and, cell by cell, copy it over 1 cell and compare the result to the source. This would probably be really slow, especially compared to some sort of built in functionality or handling based on blocks of cells.


Here's an example of a possible solution that I saw somewhere in the past. If each character below is a cell and "F" represents a new, non-copied formula and ">" represents a copied across formulas and "v" represents a copied down formula:

FFFF>>>
vvvv>>>
vvvv>>>
vvFv>>>
vvFv>>>
vvvv>>>

The 2 bold F's show that there's a break in the copied down formulas, which would indicate a likely error.

Thanks in advance for any alternate suggestions or solution ideas!
Rob
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
If you use R1C1 mode then its relatively easy because copied formulae are identical.

So I get a block ( use CurrentRegion?) of R1C1 formulae into a variant array and compare the array
 
Upvote 0
Thank you, Charles. The R1C1 suggestion is extremely helpful.

I haven't worked with CurrentRegion before, I'll have to look into that.

Rob

PS FastExcel rules. I use it before I roll out all my models
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,315
Members
452,634
Latest member
cpostell

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