Find in column range only

rmwilson

Board Regular
Joined
Apr 18, 2007
Messages
146
Can this range be modified to columns B to IV?

Set numrange = ActiveSheet.UsedRange

Thanks!
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Well thats because it is going through 255 columns by 65536 rows, this is assuming you are using Excel 2003, which would equate to 16,711,680 cells?

Maybe you want to modify the code so it doesn't go out to the last column?

Maybe just use:

Code:
lastColumn = cells(1,columns.Count).end(xltoleft).address
Set numrange = ActiveSheet.range("B1:" & Mid(lastColumn, InStr(lastColumn, "$") + 1, InStr(2, lastColumn, "$") - 2)
This limits the amount of columns looked in, but you may also want to limit the rows. That is where used range was nice. I guess you could possibly also do this:

Code:
Set numrange = activesheet.usedrange.offset(0,1).resize(,activesheet.usedrange.columns.count-1).address
Hope that helps.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,207,286
Messages
6,077,537
Members
446,288
Latest member
lihong3210

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