We’d like to remind Forumites to please avoid political debate on the Forum.
This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
assign a custom character to a keyboard key in excel
rubble2
Posts: 569 Forumite
in Techie Stuff
As above really, I produce a large number of spreadsheets into which test results are entered. In locations (cells) where no data is recorded this is indicated by entering a hyphen symbol multiple times.
I wonder is it possible to produce a custom symbol which consists of say 5 hyphens (essentially a dashed line) which could be input by hitting a single keystroke?
I have checked the special characters which are available as standard but none of them seem to be suitable, any help would be appreciated.
Thanks
I wonder is it possible to produce a custom symbol which consists of say 5 hyphens (essentially a dashed line) which could be input by hitting a single keystroke?
I have checked the special characters which are available as standard but none of them seem to be suitable, any help would be appreciated.
Thanks
0
Comments
-
If its just to indicate that the cell is "intentionally blank" rather than missed out do you need 5 dashes rather than just 1?
If its needed to draw the eye to missing data you could use conditional formatting to tune the cell red if there is just 1 dash entered0 -
It is to report that the cell is intentionally blank, one dash just looks a bit 'lost'. I have always entered multiple dashes and would prefer to continue doing so, just looking for a quicker way of achieving this.0
-
Write a macro to put your hyphens in the current cell and assign the macro to a shortcut key
How you link to a shortcut key may vary depending on Excel versionSub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+q
'
ActiveCell.FormulaR1C1 = "'
"
End SubThis is a system account and does not represent a real person. To contact the Forum Team email forumteam@moneysavingexpert.com0 -
Would it not be far simpler to use the Autocorrect function instead of writing macros?0
-
You could end up hit by the law of unintended consequences.This is a system account and does not represent a real person. To contact the Forum Team email forumteam@moneysavingexpert.com0
-
The length of time it takes you to hit a shortcut will be the same as typing
Even with using auto correct you are not going to save much time and there may be issues for instance i wouldn't recommend replacing - with
.
If there are lots of cells in a row just fill the value down.“Time is intended to be spent, not saved” - Alfred Wainwright0 -
But a macro gives guaranteed consistency of content. It's easy enough to only do 4 hyphens by mistake and if there is any counting or manipulation then errors will creep in. A macro removes that area of error.This is a system account and does not represent a real person. To contact the Forum Team email forumteam@moneysavingexpert.com0
-
http://www.extendoffice.com/documents/excel/772-excel-fill-blank-cells-with-0-or-specific-value.html
The first of these methods takes a little practice, and read the four steps carefully - but it's powerful and fast
To open the Go To | Special window, do Control+G, then press the Special button :-)0 -
I use a macro very similar to the above to add a tick (windings) in excel, that is assigned to a keyboard shortcut. Save it into my personal.xlsm and the macro is available in every spreadsheet I use.0
-
Personally I would just use a Macro for it, however, the drawback of a Macro is that you cannot undo the action. So if you accidentally run it on the wrong cell you could overwrite and lose whatever value was already there. So building on !!!!!!'s code it might be an idea to either publicly store the current ActiveCell value which can then be recalled using an 'undo' Macro should it be required...
(I've also amended the shortcut-key combination above as it's a better idea to assign Macros to uppercase letters)Public undovalue As String
Sub NoDataValue()
'
' Keyboard Shortcut: Ctrl+Shift+Q
'
undovalue = ActiveCell
ActiveCell.FormulaR1C1 = "'
"
End Sub
Sub NoDataValueUndo()
'
' Keyboard Shortcut: Ctrl+Shift+U
'
ActiveCell.FormulaR1C1 = undovalue
undovalue = Empty
End Sub
Or perhaps even easier you could just add an If clause to check if the ActiveCell is blank before entering your value...
If you find your shortcut-keys are not working, press Alt-F8, then select the Macro and click Options. Then set your preferred shortcut letter (Hold Shift to enter in uppercase) and change to Ctrl+Shift+Sub NotIfBlank()
'
' Keyboard Shortcut: Ctrl+Shift+Q
'
If ActiveCell <> "" Then Exit Sub Else
ActiveCell.FormulaR1C1 = "'
"
End Sub0
This discussion has been closed.
Confirm your email address to Create Threads and Reply
Categories
- All Categories
- 352.2K Banking & Borrowing
- 253.6K Reduce Debt & Boost Income
- 454.3K Spending & Discounts
- 245.2K Work, Benefits & Business
- 600.9K Mortgages, Homes & Bills
- 177.5K Life & Family
- 259K Travel & Transport
- 1.5M Hobbies & Leisure
- 16K Discuss & Feedback
- 37.7K Read-Only Boards
