Limiting a macro to one column

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

Sorry, that sounds really wierd, but what I want to do is this:

I have a data table of around 2000 rows and 16 columns. I want to have
a 'Delete Selected Row' button. The idea is that the selected cell and
the 15 to the right of it are cleared. I have the following code:

ActiveCell.Value = ""
ActiveCell.Offset(0, 1).Value = ""
....
ActiveCell.Offset(0, 15).Value = ""

Any cell in the table can be selected for amendment ,but how can I
amend the Button's code so that it only works if the ActiveCell is in
column B?

Thanks in advance.

Steve
 
Maybe you could just use the row that the activecell is on???

cells(activecell.row,2).resize(1,15).clearcontents

Just a thought.
 

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

Back
Top