Macro to hide rows / columns outside a specific range of values

L

Legacy 223018

Guest
Hi,

Using Excel 2007 I have been linking two databases, both containing latitude and longitude values. Through a formula I calculated the distance in miles for each entry in database 1 to each entry in database 2 using names. The new sheet contains almost 19000 rows and 500+ lines. Thus the matrix of results is pretty big (k11:vi18595).
Now I would like to filter in this order, using a macro:

1 Hide every row where in one of the databases latitude / longitude = "N/A" and where consequently the matrix returns "#VALUE!" for the whole result row;
2 Also hide every row where there is not at least one column's value between 1 and 100 miles;
3 Also hide every column where there is not at least one row's value between 1 and 100 miles.

In a further step I would like to give the user the ability to adjust the range of 1 -100 miles through a textbox, but considering the fact that I have no working code at all, I would already be grateful about any help that does not take this extra into account!

Cheers
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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