Lock Reference so it never changes

ParanoidAndroid

Board Regular
Joined
Jan 24, 2011
Messages
50
Hi Guys

I want to lock the K:K in this line so it never changes

=IF(ISERROR(MATCH(V2,'3056_LCS'!K:K,0))

How do I do this?
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Simplest is to add $ characters which keep the reference to K if you drag or copy the cells:
=IF(ISERROR(MATCH(V2,'3056_LCS'!$K:$K,0))

The reference will still change if you cut columns. Often that is desirable behavior. Otherwise, you could look into using INDIRECT(). I think something could even be done with INDEX() here too.
 
Upvote 0
Just put a $ in front of each K so K:K would become $K:$K.

manipulating these reference locks is a very handy trick so practice with them.

You can lock a Column, but let the row number change with =$K2, or lock a row but let a column change with =K$2.
 
Upvote 0
Thanks Guys

Yes, I cut columns..so that explains it.

The K:K is anticipated once all the columns are cut..

How do i used the indirect or index?
 
Upvote 0
This should work:

=IF(ISERROR(MATCH(V2,INDIRECT("3056_LCS!$K:$K"),0))

There will be a performance hit using Indirect(), but it won't matter if your workbook is not heavy with calculations.
 
Upvote 0

Forum statistics

Threads
1,213,511
Messages
6,114,054
Members
448,543
Latest member
MartinLarkin

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