JazzSP8
Well-known Member
- Joined
- Sep 30, 2005
- Messages
- 1,227
- Office Version
- 2013
- 2010
- Platform
- Windows
Hi All
I've got a macro which I've attached to a button to perform a simple operation, this works OK, however because of its nature I only want it to be able to run in certain columns.
Thing is, I can make it work only in one column, but not different columns, I thought 'Or' would have let me do it, but, alas no...
Heres the code;
Which means it will work ok in column K...
I've tried changing to;
To allow for column K and N but then it stops working completely but doesn't give me an error message.
Anyone help? - I seem to be stuggling to use the search on the message board and I'm banging my head against the keyboard.
Thanks in advance.
Jazz
I've got a macro which I've attached to a button to perform a simple operation, this works OK, however because of its nature I only want it to be able to run in certain columns.
Thing is, I can make it work only in one column, but not different columns, I thought 'Or' would have let me do it, but, alas no...
Heres the code;
Code:
WhichCol = ActiveCell.Column
If WhichCol <> 11 Then Exit Sub
Which means it will work ok in column K...
I've tried changing to;
Code:
WhichCol = ActiveCell.Column
If WhichCol <> 11 Or 14 Then Exit Sub
To allow for column K and N but then it stops working completely but doesn't give me an error message.
Anyone help? - I seem to be stuggling to use the search on the message board and I'm banging my head against the keyboard.
Thanks in advance.
Jazz