LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default UPPER CASE macro shortcut key anomaly

The following demonstrates that a macro behaves differently if the shortcut
key assigned is UPPER CASE than if the shortcut key assigned is lower case.

o Create four new blank workbooks: c:\temp\a.xls, c:\temp\b.xls,
c:\temp\c.xls, and c:\temp\d.xls
O Put an "a" in cell A1 of workbook a.xls, a "b" in cell A1 of workbook
b.xls, etc.
o In workbook a.xls create two macros as follows:

Sub open_them()
Workbooks.Open Filename:="c:\temp\b.xls"
MsgBox "Opened b.xls"
Workbooks.Open Filename:="c:\temp\c.xls"
MsgBox "Opened c.xls"
Workbooks.Open Filename:="c:\temp\d.xls"
MsgBox "Opened d.xls"
End Sub

Sub close_them()
Windows("b.xls").Activate
ActiveWindow.Close
Windows("c.xls").Activate
ActiveWindow.Close
Windows("d.xls").Activate
ActiveWindow.Close
End Sub

o Assign shortcut key (Tools/Macro/Macros/Options) o (Ctrl+o) to open_them
and c (Ctrl+c) to close_them in workbook a.xls.

o Enter Ctrl+o in workbook a.xls. Click OK to acknowledge the MsgBox for
each of b,c, and d.
The three workbooks b,c, and d are opened as expected.
o Enter Ctrl+c in workbook a.xls to close the auxiliary workbooks b,c, and d.

O Reassign the shortcut key for open_them in workbook a.xls to O (capital
letter O) (Ctrl+Shift+o)
o Enter Ctrl+Shift+o in workbook a.xls. The macro opens workbook b.xls and
proceeds no further.
Neither the MsgBox statement for "Opened b.xls" is displayed nor are
workbooks c.xls or d.xls opened.

o The above sequence fails regardless of what letters are assigned. Any
upper case letter assigned to open_them fails as above.

The problem is easily avoided by not using upper case letters for macro
shortcut keys but is rather perplexing until the cause is identified. I had
recovered/repaired/reinstalled several workbooks and Excel before isolating
the difficulty.
--

***

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert lower to upper case automatically without using UPPER Sal Excel Discussion (Misc queries) 6 July 26th 09 11:27 AM
Changing multiple cell text from lower case to upper case Patti Excel Discussion (Misc queries) 2 January 4th 08 08:35 PM
Changing upper case characters to upper/lower Richard Zignego Excel Discussion (Misc queries) 1 December 17th 07 10:09 PM
Changing file in all upper case to upper and lower case Sagit Excel Discussion (Misc queries) 15 May 30th 07 06:08 AM
How do I convert all upper case excel sheet into upper and lower . DebDay Excel Discussion (Misc queries) 1 March 9th 05 08:31 PM


All times are GMT +1. The time now is 04:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"