Clear specific row except active column

bhsoundman

Board Regular
Joined
Jul 17, 2010
Messages
50
Office Version
  1. 365
Platform
  1. MacOS
Hi All,

I'm trying to clear row 27 when any other cell is active. The catch is I do not want to clear the active column's row 27 cell. Hopefully that makes sense.

Thanks in advance
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
You're looking for what type of solution; vba code? If so then in the sheet SelectionChange event I'd probably get the value of active column row 27, delete the whole row 27 and copy the value back. Easier than trying to delete everything on both sides of a particular cell. I see that you're on a Mac though and I don't know how successful that approach might be.
 
Upvote 0
You're looking for what type of solution; vba code? If so then in the sheet SelectionChange event I'd probably get the value of active column row 27, delete the whole row 27 and copy the value back. Easier than trying to delete everything on both sides of a particular cell. I see that you're on a Mac though and I don't know how successful that approach might be.
Yes, I am looking for a VBA solution.

The problem with what you mentioned is that this is already in a SelectionChange event. Copying the value & pasting it back just creates an endless loop.
 
Upvote 0
Looks like this does exactly what I need:

Application.EnableEvents = False
Rows("27:27").ClearContents
Cells(27, ActiveCell.Column) = 1
Application.EnableEvents = True
 
Upvote 0
Solution
I can see that happening if you're using the Change event, but not SelectionChange, unless by "pasting" you are first selecting a cell. Anyway glad you have a solution. Mine was a bit lengthier and I found that I can't put any values back in row 27.
 
Upvote 0

Forum statistics

Threads
1,224,552
Messages
6,179,486
Members
452,917
Latest member
MrsMSalt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top