I am using Excel 2010 and I have a problem with using keyboard shortcuts for choosing ranges in an Inputbox.

I am using a standard Application.Inputbox with type:=8. The code prompts the user to open a file (an already existing workbook) and then prompts him with this Inputbox to select a range.

I am able to select the range with the mouse. However, the keyboard shortcuts (like CTRL+SHIFT+DOWN ARROW or CTRL+SHIFT+LEFT ARROW) for selecting a range don't work completely:

They work when I select a range in the same workbook where the code is, but they don't work on a newly opened workbook.

Is there a way to enable keyboard selection for ranges?

  • I've observed this same sort of behavior when inserting a chart or changing the data linked to the series of a chart. Highly annoying. – hBy2Py Dec 27 '14 at 3:58
  • The newly opened workbook, is that opened via VBA or some other way? Have you tried activating both the workbook and the worksheet you want the selection to be made in? – snoopen May 29 '15 at 0:13
  • @snoopen, the workbook is opened via VBA using standard Application.GetOpenFilename command. I did activate both the workbook and worksheet from which the data was to be read. I still couldn't use keyboard shortcuts though. – prem Jun 10 '15 at 12:43

I think this might be a similar issue as with the Ref Edit Control, see MS KB 213776 for details about this control which you can use for VBA UserForms. (I make extensive use of this control in my VBA solutions.)

Microsoft has provided a workaround for the problem with the Ref Edit Control here: MS KB 291110 and I can imagine this will also help you with the Application.InputBox-problem.

Edit: and after posting my answer I noticed that this question has been asked AGES ago... :-(

  • Thanks for the comment CoRrRan. Yes it was quite long ago that i posted this. Unfortunately, i do not work with project anymore. Thank you for your reference though. I'll have a look. cheers. – prem Jun 10 '15 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.