Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default More questions about copying

I've got a new challenge for you (or is it just a question) regarding the
script you have provided earlier this week.



This here lets one copy the worksheets and save individually as xls files.
GREAT!


Sub Make_New_Books()
Dim w As Worksheet
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each w In ActiveWorkbook.Worksheets
w.Copy
ActiveWorkbook.SaveAs FileName:=ThisWorkbook.Path & "\" &
w.Name
ActiveWorkbook.Close
Next w
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub




I needed to make my copied worksheets so they are saved as csv files. I
replaced the ActiveWorkbook.SaveAs line with the following



ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & w.Name,
FileFormat:=xlCSV, CreateBackup:=False

and it works GREAT!

I now have a request.


In my example I have 10 worksheets that I need saved as csv files. They are
currently named Sheet1 all the way to Sheet10

So with the above changes Sheet1 will save as Sheet.csv
GREAT!

But now we (company) need to start keeping track of things better. The boss
wants a numerical prefix added (8-10 digits long) and two suffixes (Code1
and Code2)
separated by a hyphen.



Each Code will have a list of choices, like this:
Code1
A
B
C
D
E

Code2
A
B
C
D
E

What we need is this:

When I select to save the file (before the files are copied) I need a window
to appear where we will enter the numerical prefix, then with a CONTINUE
button it would give me the option to select the Code1 choices with a Radio
Button, then Code2's choices.

I would like at the end a confirmation window with the option to CONTINUE
and CANCEL.

From my explanation I will give you the following example.
For our first trial of 10 worksheets, we want a numerical prefix of
987654321 Code1 suffix will be E Code2 will be B
Sheet1 and Sheet10, once saved would look like this:


987654321-Sheet1-E-B.csv and 987654321-Sheet1-E-B.csv, respectively.

Is this possible?

Thank You

Mr BT



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default More questions about copying Can anyone help me with this?


"Mr BT" wrote in message
news:eG7xi.65448$fJ5.11277@pd7urf1no...
I've got a new challenge for you (or is it just a question) regarding the
script you have provided earlier this week.



This here lets one copy the worksheets and save individually as xls files.
GREAT!


Sub Make_New_Books()
Dim w As Worksheet
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each w In ActiveWorkbook.Worksheets
w.Copy
ActiveWorkbook.SaveAs FileName:=ThisWorkbook.Path & "\" &
w.Name
ActiveWorkbook.Close
Next w
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub




I needed to make my copied worksheets so they are saved as csv files. I
replaced the ActiveWorkbook.SaveAs line with the following



ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & w.Name,
FileFormat:=xlCSV, CreateBackup:=False

and it works GREAT!

I now have a request.


In my example I have 10 worksheets that I need saved as csv files. They
are
currently named Sheet1 all the way to Sheet10

So with the above changes Sheet1 will save as Sheet.csv
GREAT!

But now we (company) need to start keeping track of things better. The
boss
wants a numerical prefix added (8-10 digits long) and two suffixes (Code1
and Code2)
separated by a hyphen.



Each Code will have a list of choices, like this:
Code1
A
B
C
D
E

Code2
A
B
C
D
E

What we need is this:

When I select to save the file (before the files are copied) I need a
window
to appear where we will enter the numerical prefix, then with a CONTINUE
button it would give me the option to select the Code1 choices with a
Radio
Button, then Code2's choices.

I would like at the end a confirmation window with the option to CONTINUE
and CANCEL.

From my explanation I will give you the following example.
For our first trial of 10 worksheets, we want a numerical prefix of
987654321 Code1 suffix will be E Code2 will be B
Sheet1 and Sheet10, once saved would look like this:


987654321-Sheet1-E-B.csv and 987654321-Sheet1-E-B.csv, respectively.

Is this possible?

Thank You

Mr BT





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
copying the Hyperlink function result without copying the actual formula mcheng Excel Worksheet Functions 2 June 9th 07 02:43 AM
2 questions: copying between sheets and display 0 data... Grim Excel Worksheet Functions 5 April 23rd 07 02:24 PM
Two questions - copying and averaging Beatrice Excel Discussion (Misc queries) 3 February 13th 07 06:17 PM
Questions on copying from one sheet to the other and coping every other cell. KatyLady Excel Discussion (Misc queries) 10 June 7th 05 08:29 AM
2 questions, copying data from sheet to sheet and assigning macro Boris Excel Worksheet Functions 0 December 16th 04 06:11 PM


All times are GMT +1. The time now is 04:58 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"