Sorry, we are unable to create the shortcut for one Excel function.
But you can try to use VBA code, can create a shortcut for this macro.
For example, I create a macro called Test
, the shortcut is Ctrl+Shift+T
.
Sub Test()
Dim rng As Range
For Each rng In Selection
rng.Offset(0, 2) = Trim(rng) 'The result will be offset by 2 cells to the right, but on the same line'
Next rng
End Sub
Then I can choose the cells A1:A2 that need to be trimmed from both sides, press Ctrl+Shift+T
, the results will be created on C1:C2.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.