Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 36
Default (DAVE PETERSON) - SAVE WORKSHEET AS A NEW WORKBOOK

DAVE PETERSON SAYS TO USE THIS: BUT HOW DO I SET IT UP? ALT-F11 and THEN
WHAT?
dim wks as worksheet
set wks = worksheets("somesheetnamehere")
wks.copy 'copies to a new workbook--single sheet
'save the newly created single sheet workbook.
with activeworkbook
.saveas filename:="C:\..."
.close savechanges:=false
end with

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,805
Default (DAVE PETERSON) - SAVE WORKSHEET AS A NEW WORKBOOK

Put a Sub Copymacro() before the code
and End Sun at the end.
Make updates as marked in the code
THEN
1. Open the Visual Basic Editor by going to tools-Macro's-Visual Basic
Editor or use Alt-F11
2. On the toolbar of the Visual Basic Editor, go to insert - module after
selecting the workbook on the left in which you want to use this code
3. In the module pane paste the code above.
4. Close the Visual Basic Editor By clicking the X in the upper right
corner or go to File-Close

"Gator Girl" wrote:

DAVE PETERSON SAYS TO USE THIS: BUT HOW DO I SET IT UP? ALT-F11 and THEN
WHAT?
dim wks as worksheet
set wks = worksheets("somesheetnamehere")
wks.copy 'copies to a new workbook--single sheet
'save the newly created single sheet workbook.
with activeworkbook
.saveas filename:="C:\..."
.close savechanges:=false
end with

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 36
Default (DAVE PETERSON) - SAVE WORKSHEET AS A NEW WORKBOOK

Hi Sheeloo - I don't know the first thing about this. I've written tons of
macros, but this is different. What is a Sub Copymacro( )? What is an End
Sun. Where do I start doing this? Pretend I am really stupid (generally
I'm not but about this, if the shoe fits....)

"Sheeloo" wrote:

Put a Sub Copymacro() before the code
and End Sun at the end.
Make updates as marked in the code
THEN
1. Open the Visual Basic Editor by going to tools-Macro's-Visual Basic
Editor or use Alt-F11
2. On the toolbar of the Visual Basic Editor, go to insert - module after
selecting the workbook on the left in which you want to use this code
3. In the module pane paste the code above.
4. Close the Visual Basic Editor By clicking the X in the upper right
corner or go to File-Close

"Gator Girl" wrote:

DAVE PETERSON SAYS TO USE THIS: BUT HOW DO I SET IT UP? ALT-F11 and THEN
WHAT?
dim wks as worksheet
set wks = worksheets("somesheetnamehere")
wks.copy 'copies to a new workbook--single sheet
'save the newly created single sheet workbook.
with activeworkbook
.saveas filename:="C:\..."
.close savechanges:=false
end with

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,420
Default (DAVE PETERSON) - SAVE WORKSHEET AS A NEW WORKBOOK

How can you say you have written tons of macros, but say that this is
different.

It should be End Sub, not End Sun.

--
__________________________________
HTH

Bob

"Gator Girl" wrote in message
...
Hi Sheeloo - I don't know the first thing about this. I've written tons
of
macros, but this is different. What is a Sub Copymacro( )? What is an
End
Sun. Where do I start doing this? Pretend I am really stupid
(generally
I'm not but about this, if the shoe fits....)

"Sheeloo" wrote:

Put a Sub Copymacro() before the code
and End Sun at the end.
Make updates as marked in the code
THEN
1. Open the Visual Basic Editor by going to tools-Macro's-Visual Basic
Editor or use Alt-F11
2. On the toolbar of the Visual Basic Editor, go to insert - module
after
selecting the workbook on the left in which you want to use this code
3. In the module pane paste the code above.
4. Close the Visual Basic Editor By clicking the X in the upper right
corner or go to File-Close

"Gator Girl" wrote:

DAVE PETERSON SAYS TO USE THIS: BUT HOW DO I SET IT UP? ALT-F11 and
THEN
WHAT?
dim wks as worksheet
set wks = worksheets("somesheetnamehere")
wks.copy 'copies to a new workbook--single sheet
'save the newly created single sheet workbook.
with activeworkbook
.saveas filename:="C:\..."
.close savechanges:=false
end with



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 36
Default (DAVE PETERSON) - SAVE WORKSHEET AS A NEW WORKBOOK

Why are you angry, Bob? The way I've created Macros is by clicking on
record Macro, doing a few things, then clicking on stop recording. So when
I say I've written macros, I guess it is better to say I have "recorded"
them. I don't know how to write from scratch. I don't know where to start.
I have spent hours searching for online help, but the results I find are not
basic enough. I need Visual Basic for dummies.

"Bob Phillips" wrote:

How can you say you have written tons of macros, but say that this is
different.

It should be End Sub, not End Sun.

--
__________________________________
HTH

Bob

"Gator Girl" wrote in message
...
Hi Sheeloo - I don't know the first thing about this. I've written tons
of
macros, but this is different. What is a Sub Copymacro( )? What is an
End
Sun. Where do I start doing this? Pretend I am really stupid
(generally
I'm not but about this, if the shoe fits....)

"Sheeloo" wrote:

Put a Sub Copymacro() before the code
and End Sun at the end.
Make updates as marked in the code
THEN
1. Open the Visual Basic Editor by going to tools-Macro's-Visual Basic
Editor or use Alt-F11
2. On the toolbar of the Visual Basic Editor, go to insert - module
after
selecting the workbook on the left in which you want to use this code
3. In the module pane paste the code above.
4. Close the Visual Basic Editor By clicking the X in the upper right
corner or go to File-Close

"Gator Girl" wrote:

DAVE PETERSON SAYS TO USE THIS: BUT HOW DO I SET IT UP? ALT-F11 and
THEN
WHAT?
dim wks as worksheet
set wks = worksheets("somesheetnamehere")
wks.copy 'copies to a new workbook--single sheet
'save the newly created single sheet workbook.
with activeworkbook
.saveas filename:="C:\..."
.close savechanges:=false
end with






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default (DAVE PETERSON) - SAVE WORKSHEET AS A NEW WORKBOOK

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

Option Explicit
Sub testme()
dim wks as worksheet
'change this to the worksheet that you need to copy
set wks = worksheets("somesheetnamehere")

wks.copy 'copies to a new workbook--single sheet

'save the newly created single sheet workbook.
with activeworkbook
'change the C:\... to a real, existing location with a valid filename
'like
.saveas filename:="C:\my documents\myfilename.xls", _
fileformat:=xlworkbooknormal
.close savechanges:=false
end with
End Sub

(I added another parameter to the .saveas line in this version.)

Gator Girl wrote:

DAVE PETERSON SAYS TO USE THIS: BUT HOW DO I SET IT UP? ALT-F11 and THEN
WHAT?
dim wks as worksheet
set wks = worksheets("somesheetnamehere")
wks.copy 'copies to a new workbook--single sheet
'save the newly created single sheet workbook.
with activeworkbook
.saveas filename:="C:\..."
.close savechanges:=false
end with


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,420
Default (DAVE PETERSON) - SAVE WORKSHEET AS A NEW WORKBOOK

Nobody is angry. You asked the very simplest question, even if you record
macros don't you ever look at them and try and see how they do what (you
know) they do?

There is a Visual Basic for Dummies book.

--
__________________________________
HTH

Bob

"Gator Girl" wrote in message
...
Why are you angry, Bob? The way I've created Macros is by clicking on
record Macro, doing a few things, then clicking on stop recording. So
when
I say I've written macros, I guess it is better to say I have "recorded"
them. I don't know how to write from scratch. I don't know where to
start.
I have spent hours searching for online help, but the results I find are
not
basic enough. I need Visual Basic for dummies.

"Bob Phillips" wrote:

How can you say you have written tons of macros, but say that this is
different.

It should be End Sub, not End Sun.

--
__________________________________
HTH

Bob

"Gator Girl" wrote in message
...
Hi Sheeloo - I don't know the first thing about this. I've written
tons
of
macros, but this is different. What is a Sub Copymacro( )? What is
an
End
Sun. Where do I start doing this? Pretend I am really stupid
(generally
I'm not but about this, if the shoe fits....)

"Sheeloo" wrote:

Put a Sub Copymacro() before the code
and End Sun at the end.
Make updates as marked in the code
THEN
1. Open the Visual Basic Editor by going to tools-Macro's-Visual
Basic
Editor or use Alt-F11
2. On the toolbar of the Visual Basic Editor, go to insert - module
after
selecting the workbook on the left in which you want to use this code
3. In the module pane paste the code above.
4. Close the Visual Basic Editor By clicking the X in the upper
right
corner or go to File-Close

"Gator Girl" wrote:

DAVE PETERSON SAYS TO USE THIS: BUT HOW DO I SET IT UP? ALT-F11
and
THEN
WHAT?
dim wks as worksheet
set wks = worksheets("somesheetnamehere")
wks.copy 'copies to a new workbook--single sheet
'save the newly created single sheet workbook.
with activeworkbook
.saveas filename:="C:\..."
.close savechanges:=false
end with






Reply
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
Dave Peterson...Oh no, not her again... Lynda Excel Discussion (Misc queries) 3 October 12th 08 04:07 PM
Dave Peterson Bob Myers Excel Worksheet Functions 2 January 9th 08 03:33 PM
Dave Peterson Rich_Patterson Excel Discussion (Misc queries) 2 January 26th 07 08:56 PM
Dave Peterson joelbeveridge Excel Discussion (Misc queries) 1 August 4th 06 02:55 AM
to Dave Peterson Ross Excel Discussion (Misc queries) 2 September 18th 05 04:45 PM


All times are GMT +1. The time now is 02:29 PM.

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

About Us

"It's about Microsoft Excel"