LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 14
Default Moving data from master sheet to new sheets

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

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


What a small world.... I'm actually planning on attending the Kitchen and Bath Industry Show in
Vegas this Monday through Thursday - but I have a full schedule of meetings, breakfasts, lunches,
and dinners... Thanks for the offer, and thanks for letting me know that the code worked for you

Bernie
MS Excel MVP


Well have fun in Vegas, and just in case you wanted a bit more
trivia....
Instead of just creating a new sheet, I want to copy a template I have
for the data to be placed in, and use that. I was able to add a few
lines to delete the default Sheet1,Sheet2 etc, but I was unable to get
the copy template deal to work. I didn't ask before because I want to
be able to learn this stuff, and you can't learn it unless you have
some trial and error. Here is the current code I am working with,
and I want to use a template sheet called "TEMPLATE". Thanks again
for all your help Bernie!

Sub TryNow3()
Dim myName As String
Dim myCell As Range
Dim CellAdd1 As String
Dim CellAdd2 As String
Dim CellAdd3 As String
Dim myPath As String

myPath = "C:\Documents and Settings\r***" ' path changed

'CellAdd1 = "A16"
CellAdd2 = "A18"
CellAdd3 = "E18"

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(CellAdd1).Value = myCell(1, 1).Value
ActiveSheet.Range(CellAdd2).Value = myCell(1, 2).Value
ActiveSheet.Range(CellAdd3).Value = myCell(1, 3).Value
Else
ActiveWorkbook.Worksheets.Add
ActiveSheet.Name = myCell(1, 2).Value
'ActiveSheet.Range(CellAdd1).Value = myCell(1, 1).Value
ActiveSheet.Range(CellAdd2).Value = myCell(1, 2).Value
ActiveSheet.Range(CellAdd3).Value = myCell(1, 3).Value
'Delete Unused Sheets
'Turn off run time errors and delete alert
On Error Resume Next
Application.DisplayAlerts = False
Worksheets("Sheet1").Delete
Worksheets("Sheet2").Delete
Worksheets("Sheet3").Delete
End If
Next myCell

ActiveWorkbook.SaveAs myName, xlNormal
ActiveWorkbook.Close False

End Sub



 
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
Moving primary data from master sheet to individual sheets w/in wo willie091028 Excel Discussion (Misc queries) 1 January 13th 07 04:33 AM
Getting info from individual sheets into master sheet [email protected] Excel Worksheet Functions 4 November 21st 06 10:05 AM
Getting info from individual sheets into master sheet [email protected] Excel Discussion (Misc queries) 1 November 17th 06 05:24 PM
link between sheets get messed when master sheet is sorted Kt Excel Worksheet Functions 1 October 30th 05 12:24 PM
how do changes made on shared sheets show up in a master sheet? usarmycwo Excel Worksheet Functions 3 November 30th 04 05:26 AM


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