Excel question--"deselecting" rows/columns

Say that I’m trying to delete some rows in my spreadsheet.

I want to delete rows #5,7,11, and 12.

In theory, I hold down the ALT key, highlight row 5, row 7, row 11, and row 12, then right-click and delete.

However, I accidentally highlighted row 10 instead of row 11. Is there any way to “unselect” row 10? Or do you just have to start over from the first?

I think you mean Ctrl key - you just have to de-select and select again. I haven’t heard of any other way.

actually I found a macro by Chip Pearson - not sure if it will work, but I guess macros is the answer.

Sub UnSelectActiveCell() Dim rng As Range Dim FullRange As Range 'Chip Pearson If Selection.Cells.Count > 1 Then For Each rng In Selection.Cells If rng.Address <> ActiveCell.Address Then If FullRange Is Nothing Then Set FullRange = rng Else Set FullRange = Application.Union(FullRange, rng) End If End If Next rng

If FullRange.Cells.Count > 0 Then FullRange.Select End If End If

End Sub

Sub UnSelectActiveArea() 'Chip Pearson Dim rng As Range Dim FullRange As Range Dim Ndx As Integer If Selection.Areas.Count > 1 Then For Each rng In Selection.Areas If Application.Intersect(ActiveCell, rng) Is Nothing Then If FullRange Is Nothing Then Set FullRange = rng Else Set FullRange = Application.Union(FullRange, rng) End If End If Next rng FullRange.Select End If

End Sub

Shift-select chooses (unchooses) a range of cells, rows, or columns.

Ctrl-select chooses (unchooses) a specific cell, row, or column.

Yeah, that’s what I meant. Sorry.

I don’t remember which is which. The fingers just naturally gravitate to the right key.

Right–but I have a spreadsheet with 30 columns, and I don’t want about 20 of them. They’re not side-by-side. So the only way to do it is to delete them one-by-one. Or use Ctrl to select them individually, then delete them.

But if you accidentally highlight the wrong one, you have to start all over.

If it’s a small spreadsheet, it’s not that big of a deal. If it’s a big one, then it takes a long time to start all over.

If you know all of the rows you want to delete, you can press crtl-g and type in the rows as references (ie 5:5,7:7,11:11,12:12) and it will highlight them for you. Not sure if that is more or less of a pain but it’s an option. As far as I know there is not a way to unselect a specific row just using a ctrl-click.

sounds like a good quick 'n dirty

If the data is labeled, I’d build an index match or hlookup (depending on data structure) and pull over the columns I need on another sheet. Then copy/paste as values. And then delete all the original columns.

Ditch the mouse. Use the arrow keys to select a cell in the column / row you want to delete, then:

For a column:

Ctrl + Space, Ctrl + - (the minus key)

Or

Alt, H, D, C (Home, Delete, Column)

For a row:

Shift + Space, Ctrl + - (the minus key)

Or

Alt, H, D, R (Home, Delete, Row)

Once you get quick with it you can do it just about as fast as you can decide you want to get rid of them.

I will sometimes sort a set of columns to put everything I want to delete at the far right and then just delete them in a batch. You just copy the number 1 across a row and give every row you want to delete a big number. If you care about the order, you can make them increment and then just give every column you want to delete the number 100 or something. Then sort columns by this index and delete as a bloc.

I do this more with unneeded rows but it sometimes is the fastest way with columns too.

Glory hallelujah!!! In the newest iteration of Excel, you can “de-click” a highlighted row or column!!!

I got so excited by this, I though I’d bump a 5 year old thread!!!

edit - for the record, I’m using 365. Don’t know what version we’re on now.

Yeah it seems like a small change but literally was game changing for me. Saves so much time After allowing this feature they removed it for a while to fix something and I felt heart broken