Using .Find

mchac

Well-known Member
Joined
Apr 15, 2013
Messages
531
I'm using the following to find the last column that has the search string "=SUM" in it:

Code:
LAST_COLUMN_OF_INTEREST_NUMBER = Sheets(PRUNE_SHEET).Cells.Find("=SUM", Sheets(PRUNE_SHEET).Range("A1"), xlFormulas, xlPart, xlByRows, xlPrevious).Column

This correctly finds that col num 69 (BS) is the last column where "=SUM" exists as part of a formula.

As a test, in Step mode I deleted row BS, moved the execution line back to this, hit F8 so it will re-evaluate and it still gives me the same answer.

I thought it would return col num 68. Can anyone help me understand why it doesn't?

UPDATE:
My error, 69 is BQ and that is the correct value.
Ignore this question.
 
Last edited:

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Watch MrExcel Video

Forum statistics

Threads
1,130,117
Messages
5,640,203
Members
417,131
Latest member
Seanr19871

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
Top