This is a great forum. I have received some excellent advice so I am hoping you all can help me out again.

I have a macro with Dynamic ranges. For example, they search financial data, looking for specific account codes (all contained in one column) and returns all financial activity for each instance of that account (3 columns before and 5 columns after for each row containing the account). Here is an example formula:

=OFFSET(INDIRECT(ADDRESS(MATCH(40400,Sheet1!$E:$E, 0),5)),0,-3,COUNTIF(Sheet1!$E:$J,40400),COUNTA(Sheet1!$4:$4) )

If the account is present this works fine. However if the data is not present I get a Visual Basic Error.

Can anyone help me get around this problem? I there a way I can program sort of an IF/Then type arguement.....if there is no data to pull, go to the next step?