View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
BeanCounterSue BeanCounterSue is offline
external usenet poster
 
Posts: 5
Default Using Ron's Sub Copy_to_Workbooks

Thanks for the quick response Barb!

I should have been more specific tho. I need to add to Ron's code but I
don't know exactly where and how. When I use this code (with my hard-coded
changes in it for file name, filter column, columns & rows), I run it from
ONE workbook with ONE sheet. It applies filters, etc then copies and pastes
the filtered data into about 30 new WorkBooks....all named with the Unique
name the filter was on, with all of Single sheets in the 30 new workbooks are
all named "Sheet1."

I'd like to have it prompt me for : a "suffix" to add to the end of the
WorkBook names (MM-YY), and prompt me for the correct name of the single
WorkSheet (like "Charges" or "Saved".) All workBooks would have the same
MM-YY suffix, and all the single sheets in those 30 workbooks would have the
same sheet name.

Thanks again,
Sue




"Barb Reinhardt" wrote:

To suppress the messages try this

Application.DisplayAlerts = FALSE 'Before the save and
Application.DisplayALerts = TRUE 'To turn it back on

For the next part, I'm assuming the sheet names are Sheet 1, Sheet 2, etc.

Sub test()
Dim Myname As String
Dim WS As Worksheet

Myname = InputBox("enter sheet name")
Debug.Print Myname

For Each WS In ThisWorkbook.Worksheets
WS.Name = Replace(WS.Name, "Sheet", Myname)

Next WS

End Sub


You'll need to have the WS defined as a worksheet somewhere in your code.

If you want to prompt for something try this

myName = InputBox("Enter Sheet Name")


--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.