Limit due to selected cells

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
 
J

Jacob Skaria

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top