From: Basta1980 on 6 May 2010 04:22 G'morning, I have a to-do-list in Excel consisting of 5 columns (A:E). Every new task is on a new row. If needed I can create tasks in Outlook with the help of commandbutton (which has code assigned to it that extracts the info I need to the body of the task). What I would like to do now is to create an extra statement (within the current statement) that states that if I'm not in a cell in column D the code behind the commandbutton does not work (to prevent faults or tasks that are unclear). Any help would be greatly appreciated. Regards, Basta 1980
From: Jacob Skaria on 6 May 2010 04:59 Try If ActiveCell.Column <> 4 Then 'your current code End If OR place the below on top of your current procedure If ActiveCell.Column = 4 Exit Sub -- Jacob (MVP - Excel) "Basta1980" wrote: > G'morning, > > I have a to-do-list in Excel consisting of 5 columns (A:E). Every new task > is on a new row. If needed I can create tasks in Outlook with the help of > commandbutton (which has code assigned to it that extracts the info I need to > the body of the task). What I would like to do now is to create an extra > statement (within the current statement) that states that if I'm not in a > cell in column D the code behind the commandbutton does not work (to prevent > faults or tasks that are unclear). Any help would be greatly appreciated. > > Regards, > > Basta 1980
From: Basta1980 on 6 May 2010 06:26 Jacob, Thnx again. Works like a charm Regards Basta1980 "Jacob Skaria" wrote: > Try > > If ActiveCell.Column <> 4 Then > 'your current code > End If > > OR place the below on top of your current procedure > > If ActiveCell.Column = 4 Exit Sub > > > -- > Jacob (MVP - Excel) > > > "Basta1980" wrote: > > > G'morning, > > > > I have a to-do-list in Excel consisting of 5 columns (A:E). Every new task > > is on a new row. If needed I can create tasks in Outlook with the help of > > commandbutton (which has code assigned to it that extracts the info I need to > > the body of the task). What I would like to do now is to create an extra > > statement (within the current statement) that states that if I'm not in a > > cell in column D the code behind the commandbutton does not work (to prevent > > faults or tasks that are unclear). Any help would be greatly appreciated. > > > > Regards, > > > > Basta 1980
|
Pages: 1 Prev: Sub to freeze cols up to extent of data in col Q Next: Cell referencing in Macros |