View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Midget Midget is offline
external usenet poster
 
Posts: 14
Default Moving data from master sheet to new sheets

On May 4, 12:22 pm, "Bernie Deitrick" <deitbe @ consumer dot org
wrote:
Ryan,

Try the macro below, first selecting your entire table. I assumes by Cell 18 you meant cell A18....
Also, change the string myPath to the folder path where you want to save these workbooks.

HTH,
Bernie
MS Excel MVP

Sub TryNow()
Dim myName As String
Dim myCell As Range
Dim CellAdd As String
Dim myPath As String

myPath = "C:\Excel\"

CellAdd = "A18"

myName = ""

For Each myCell In Intersect(Range("A:A"), Selection)

If myCell.Value < "" Then
If myName < "" Then
ActiveWorkbook.SaveAs myName, xlNormal
ActiveWorkbook.Close False
End If
myName = myPath & myCell.Value & ".xls"
Workbooks.Add
ActiveWorkbook.Worksheets.Add
ActiveSheet.Name = myCell(1, 2).Value
ActiveSheet.Range(CellAdd).Value = myCell(1, 3).Value
Else
ActiveWorkbook.Worksheets.Add
ActiveSheet.Name = myCell(1, 2).Value
ActiveSheet.Range(CellAdd).Value = myCell(1, 3).Value
End If
Next myCell

ActiveWorkbook.SaveAs myName, xlNormal
ActiveWorkbook.Close False

End Sub

"Midget" wrote in message

ups.com...

Here is the problem, I have a worksheet in which there are 3 columns.
Column A contains the names of new workbooks, Column B contains the
names of the new worksheets within the new workbook, and Column C
contains the data for each worksheet within the workbook. My data
looks something like the following...
A B C
1 Close F Street A3590 Removals
2 A3600 Road Exc.
3 Temp Tie In A3630 Removals
4 A3640 Road Exc.
5 Connect to D Street A3660 Removals.


Is what I am trying to do even possible? To re-explain this with the
example above...
I want this to create a new Workbook called Close F Street, that
workbook will have 2 worksheets called A3590 and A 3600, and The
column C data will be in Cell 18, so Sheet A3590 will have Removals in
Cell 18 and Sheet A3600 will have Road Exc. in Cell 18.


I hope this makes sense. I have tried to accomplish this on my own
but can't get anywhere.


Thanks for your response.


Ryan



Bernie! You are amazing, That is exactly what I was trying to
accomplish! Lunch is on me if you are ever in Vegas!