Limit due to selected cells

  • Thread starter Thread starter Basta1980
  • Start date Start date
B

Basta1980

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
 
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
 
Back
Top