Assistanec with Code much appreciated

  • Thread starter Thread starter Gerry
  • Start date Start date
G

Gerry

Can someone write me a wee snippit of VBA which I can attach to a
button. I would like to be able to click a button with would run a
filter on Column N in my spreadsheet. The result of the filter would
show all entries which began with the letter J and ended with the
letter N. It would also show all entries which do not begin with J
but do end in Y.

For info, the entries in column N are no more than a dozen letters and
no spaces exist.

Many thanks
 
Gerry

You could use a helper column to decide whether or not these conditions are
true (or false) and filter on true.

=OR(AND(LEFT(n2,1)="J",RIGHT(N2,1)="N"),AND(LEFT(N2,1)<>"J",RIGHT(N2,1)="Y"))

Entered in the helper column and copied down use a label Test in N1

Hope this helps
Peter
 
Back
Top