If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
Personal macro csv file
If you used ctrl-W make sure you hit ctrl-shift-w (uppercase w).
ctrl-w (lower case) is the shortcut to close the activewindow. And if the workbook only has a single window, you'd be trying to close the workbook. "BNT1 via OfficeKB.com" wrote: Thank you Dave, amended macro as suggested Got the attachement in the email - tools/macro /run ( personal macro by the way) and it worked a treat I do notice that the shortcut key (Ctrl+W) just closes the file and not run the macro, even when saved and re-opened Perhaps this is something that I will have to live with ? Thanks again Brian Dave Peterson wrote: Before you do anything, make your file the way you normally do. Add the macro. Save the file. Close excel. Re-open excel. Reopen your file. Do you still see you code in that workbook's module? If you don't see that module, then something is going wrong--I'd guess that you're not saving the file as a normal workbook (*.xls). You may be saving it as a .csv and those .csv files are just plain old text files. But since those plain old .csv files are "owned" by excel, they can still be called excel files. (The lingo can be confusing.) On the other hand, if you do see your module in the project, then you're doing fine. Maybe you can change the code so that it doesn't depend on the name of the worksheet. You may be able to do everything without naming a range (just use range object variables). Or your code could rely on the activesheet. with activesheet 'for a global/workbook name .range("A1:X99").name = "SomeNameHere" 'for a local/worksheet level name .range("a1:x99").name = "'" & .name & "'!SomeNameHere" end with Hi [quoted text clipped - 26 lines] Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200910/1 -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200910/1 -- Dave Peterson |
#12
|
|||
|
|||
Personal macro csv file
Well, that explains why it kept closing the workbook !
I will try this at work in the morning, however, do I have to set the macro lowercase w to capital W, secondly, is this Ctrl - Shift - always used when setting your own shortcut, or do you have to remember the ones already set in excel? Regards Dave Peterson wrote: If you used ctrl-W make sure you hit ctrl-shift-w (uppercase w). ctrl-w (lower case) is the shortcut to close the activewindow. And if the workbook only has a single window, you'd be trying to close the workbook. Thank you Dave, amended macro as suggested Got the attachement in the email - tools/macro /run ( personal macro by the [quoted text clipped - 46 lines] Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200910/1 -- Message posted via http://www.officekb.com |
#13
|
|||
|
|||
Personal macro csv file
If you're using tools|macro|macros (select the macro) and click Options
You'll see that that label for the shortcut key will change from Ctrl to Ctrl-Shift when you type an uppercase key. If you want to use an excel shortcut (I wouldn't!), it'll be up to use one that you don't use very often. There are lots I'd stay away from. A few years ago, I was interested in what letter keys were available (not in-use) for shortcuts. (I think in the xl97 days...) L, Q, T were available in excel and E, M, J were used in the VBE, but not in excel proper. But I don't like using shortcut keys. Once the number of utility macros you have gets more than a couple, it's difficult to remember (for me, at least). I'd use a toolbar or modify the worksheet menubar (xl2003 choices)... ====== (Saved from a previous post) For additions to the worksheet menu bar, I really like the way John Walkenbach does it in his menumaker workbook: http://j-walk.com/ss/excel/tips/tip53.htm Here's how I do it when I want a toolbar: http://www.contextures.com/xlToolbar02.html (from Debra Dalgleish's site) In xl2007, those toolbars and menu modifications will show up under the addins. And if you use xl2007: If you want to learn about modifying the ribbon, you can start at Ron de Bruin's site: http://www.rondebruin.nl/ribbon.htm http://www.rondebruin.nl/qat.htm -- For macros for all workbooks (saved as an addin) or http://www.rondebruin.nl/2007addin.htm "BNT1 via OfficeKB.com" wrote: Well, that explains why it kept closing the workbook ! I will try this at work in the morning, however, do I have to set the macro lowercase w to capital W, secondly, is this Ctrl - Shift - always used when setting your own shortcut, or do you have to remember the ones already set in excel? Regards Dave Peterson wrote: If you used ctrl-W make sure you hit ctrl-shift-w (uppercase w). ctrl-w (lower case) is the shortcut to close the activewindow. And if the workbook only has a single window, you'd be trying to close the workbook. Thank you Dave, amended macro as suggested Got the attachement in the email - tools/macro /run ( personal macro by the [quoted text clipped - 46 lines] Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200910/1 -- Message posted via http://www.officekb.com -- Dave Peterson |
#14
|
|||
|
|||
Personal macro csv file
thank you Dave - took your advise - we are not getting any younger !. have
modified my tool bar and works perfect Dave Peterson wrote: If you're using tools|macro|macros (select the macro) and click Options You'll see that that label for the shortcut key will change from Ctrl to Ctrl-Shift when you type an uppercase key. If you want to use an excel shortcut (I wouldn't!), it'll be up to use one that you don't use very often. There are lots I'd stay away from. A few years ago, I was interested in what letter keys were available (not in-use) for shortcuts. (I think in the xl97 days...) L, Q, T were available in excel and E, M, J were used in the VBE, but not in excel proper. But I don't like using shortcut keys. Once the number of utility macros you have gets more than a couple, it's difficult to remember (for me, at least). I'd use a toolbar or modify the worksheet menubar (xl2003 choices)... ====== (Saved from a previous post) For additions to the worksheet menu bar, I really like the way John Walkenbach does it in his menumaker workbook: http://j-walk.com/ss/excel/tips/tip53.htm Here's how I do it when I want a toolbar: http://www.contextures.com/xlToolbar02.html (from Debra Dalgleish's site) In xl2007, those toolbars and menu modifications will show up under the addins. And if you use xl2007: If you want to learn about modifying the ribbon, you can start at Ron de Bruin's site: http://www.rondebruin.nl/ribbon.htm http://www.rondebruin.nl/qat.htm -- For macros for all workbooks (saved as an addin) or http://www.rondebruin.nl/2007addin.htm Well, that explains why it kept closing the workbook ! [quoted text clipped - 18 lines] -- Message posted via http://www.officekb.com -- Message posted via http://www.officekb.com |
|
Thread Tools | |
Display Modes | |
|
|