It's been a while since I used Excel on a PC. In Excel on a PC, I believe if you have a set of data and want to select all the cells in the same row from where the cursor is to the last cell below a set of data, you could use Ctrl - Shift - ←. On a Mac (Excel 2011) this selects all the cells until the end of the entire row. How on Excel 2011 (Mac) can I select all the empty cells in a row until beneath a set of data? The reason for doing this is if I want to copy the current row and paste that to another row of data. I should be able to copy the current row, then hit down, then (I thought) Ctrl - Shift - ←, then paste and I would paste in another set of data. How to use the 'Control' key in Excel on a Mac using Bootcamp I'm running excel on a macbook pro using bootcamp. I've been having some keyboard driver issues. By using the SHIFT and/or the CTRL keys you can select non-contiguous ranges. However, if you select a cell or area by mistake, there is no built in way to remove that from the selection without losing the entire selection and having to start over. Describes to VBA procedures, UnSelectActiveCell and UnSelectCurrentArea that will remove the Active Cell or the Area containing the Active Cell from the current selection. All other cells in the Selection will remain selected. Your best bet would be to add these to your Personal Macro workbook so that they are available to all open workbooks in Excel. This procedure will remove the Active Cell from the Selection. Sub UnSelectActiveCell() Dim R As Range Dim RR As Range For Each R In Selection.Cells If StrComp(R.Address, ActiveCell.Address, vbBinaryCompare) 0 Then If RR Is Nothing Then Set RR = R Else Set RR = Application.Union(RR, R) End If End If Next R If Not RR Is Nothing Then RR.Select End If End Sub This procedure will remove the Area containing the Active Cell from the Selection. Sub UnSelectCurrentArea() Dim Area As Range Dim RR As Range For Each Area In Selection.Areas If Application.Intersect(Area, ActiveCell) Is Nothing Then If RR Is Nothing Then Set RR = Area Else Set RR = Application.Union(RR, Area) End If End If Next Area If Not RR Is Nothing Then RR.Select End If End Sub. A more robust way for deselecting multiple cells is described in this. It does include an extra prompt, but you can deselect an arbitrary number of cells/selections at once (instead of deselecting only the active cell or area) I'm posting the script here, with a small usability improvement (conditionally removed the redundant first prompt from the original post): Sub DeselectCells() Dim rng As Range Dim InputRng As Range Dim DeleteRng As Range Dim result As Range xTitleId = 'Deselect Cells' Set InputRng = Application.Selection If InputRng.Count.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2019
Categories |