简体   繁体   中英

Excel 2010 Cell Selection Macro

So I'm floored that there is not a hotkey to do this. I went on Microsoft's site to check the Excel hotkeys and there isn't one.

All I want to do is have a hotkey that copies the contents of a cell that I have currently selected. I don't want to use my mouse at all. Is this possible? The only solution that Microsoft provides is:

  1. Hit F2 to edit the contents of the selected cell
  2. Select text with Shift+Arrow (Not Ctrl+A mind you, this does not work in a cell)
  3. Hit Ctrl+X or Ctrl+C to copy the value.

Microsoft Description

Why is there not hotkey for this? Can one be made? It would make my life a lot easier.

You will have to assign the macro to your own hotkey but this will add the ActiveCell text to the clipboard. Add a reference to the Microsoft Forms 2.0 Object Library

Sub hotKeyCopy()
Dim DataObj As New MSForms.DataObject
Dim copyText As String
copyText = ActiveCell.Text
DataObj.SetText copyText
DataObj.PutInClipboard
End Sub

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM