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

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,078
Latest member
skydd

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