function on the print area

L

lil_gem

I am trying to create a macro to find duplicated companies in a list. I have
a function which will tell me if a company is duplicated, but my problem is
that it is defined on (e.g. A2:A300). I want to define the formula on the
print area so that the macro can be used on any list (with any number of
rows) without having to change the macro. I have tried defining it on the
whole column (A:A), but I guess since it has to compare to each value, this
does not work. I need a way to define a function from A2 to A"final row of
print area".

Can anyone help me please?
 
M

Martin Fishlock

Hi

Have a look at the PageSetup.PrintArea property.

This will return the area for printing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top