Disable Ctrl D for particular workbook

0 votes
How to disable the CTRL+D shortcut for a particular workbook? I can disable Macro but macros will affect all the excel workbooks.
Nov 8, 2022 in Others by Kithuzzz
• 38,010 points
1,020 views

1 answer to this question.

0 votes

When you click CTRL+D, it will now check the workbook's name; if it is Book1, nothing will happen; if not, the default fill down event will take place.

Sub Sample()
Application.OnKey "^d", "CheckWorkbook"
End Sub

Sub CheckWorkbook()
If ActiveWorkbook.Name = "Book1" Then
    Exit Sub
Else
    Selection.FillDown
End If
End Sub

Or

Sub Sample()
Application.OnKey "^d", "CheckWorkbook"
End Sub

Sub CheckWorkbook()
If ActiveWorkbook.Name <> "Book1" Then
    Selection.FillDown
End If
End Sub
answered Nov 8, 2022 by narikkadan
• 63,700 points

Related Questions In Others

0 votes
1 answer

Get instances of rows in excel for a particular group

You can use the COUNTIF function with ...READ MORE

answered Feb 2, 2023 in Others by narikkadan
• 63,700 points
472 views
0 votes
1 answer

Creating sheets with names in column B and assigning data to each sheet for particular name

after the first occurrence of Set sht = ...READ MORE

answered Feb 13, 2023 in Others by narikkadan
• 63,700 points
606 views
0 votes
1 answer

Creating custom property for .net assembly

While your compiler does not really support ...READ MORE

answered Nov 13, 2018 in Others by DataKing99
• 8,240 points
452 views
+2 votes
2 answers
0 votes
1 answer

Retrieve epay.info Balance with VBA and Excel

This code should log you in, provided ...READ MORE

answered Sep 5, 2018 in Blockchain by digger
• 26,740 points
980 views
0 votes
1 answer

How to load file to Excel Power query from SFTP site

Currently, I don't think there is a ...READ MORE

answered Dec 3, 2018 in Power BI by Upasana
• 8,620 points
3,332 views
0 votes
1 answer

Using VBA Excel to create a gramatically correct list

The Excel AND function is a logical ...READ MORE

answered Feb 9, 2022 in Others by gaurav
• 23,260 points
640 views
0 votes
2 answers

How to copy a formula horizontally within a table using Excel VBA?

Hi so basically, create an adjacent column ...READ MORE

answered Feb 16, 2022 in Others by Edureka
• 13,670 points
855 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP