View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default 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