Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy/paste selected worksheets
Hi,
I have this function that will create and save the workbook under the name input by the user. Now, I need to enter a copy/paste function somewhere in there that will copy the the selected worksheets in the master workbook and paste them into the newly created workbook. This might be simple but I can't figure this one out. Thanks in advance. What I have is this: Private Sub CommandButton1_Click() Dim myStr As String Dim newWkbk As Workbook Do myStr = InputBox(prompt:="Enter PO# :") If Trim(myStr) = "" Then Exit Sub ' or what?? End If If IsNumeric(myStr) Then If Val(myStr) = CLng(myStr) _ And Val(myStr) < 999999 Then myStr = Format(Val(myStr), "000000") Exit Do End If End If Loop Set newWkbk = Workbooks.Add(1) newWkbk.SaveAs Filename:=ThisWorkbook.Path & "J:\Rec_Share\Customers for Shipping\" _ & "PO# " & myStr & " " & Format(Date, "(mm-dd-yy)") & ".xls", _ FileFormat:=xlWorkbookNormal End Sub Best Regards, Mjack --- Message posted from http://www.ExcelForum.com/ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copy selected rows to second worksheet (NOT Cut + Paste) | New Users to Excel | |||
Macro to copy & paste-special-values data to selected worksheets | Excel Discussion (Misc queries) | |||
copy only selected worksheets | Excel Discussion (Misc queries) | |||
How I can copy / paste a selected cells to other columns in Excel | Excel Discussion (Misc queries) | |||
How to Copy & Paste selected Range in Excel (MFC) | Excel Programming |