Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() I'm using the following macro to take the value in cell B2 and save each worksheet and the worksheet called "Schedule" into their own workbooks. It keeps hanging at the line that reads ".value = wks.name Any ideas how to fix this? Mike Option Explicit Sub testme() Dim wks As Worksheet For Each wks In ActiveWindow.SelectedSheets Worksheets(Array("Schedule", wks.Name)).Copy With ActiveSheet ..Parent.Worksheets("Schedule").Move _ befo=.Parent.Worksheets(1) With .Parent.Worksheets(wks.Name).Range("B2") ..NumberFormat = "text" ..Value = wks.Name End With ..Parent.SaveAs Filename:="\\bdfiler\masterads\2007 Master Ad" & wks.Name & ".xls", _ FileFormat:=xlWorkbookNormal ..Parent.Close savechanges:=False End With Next wks End Sub |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
See your previous thread.
MikeD1224 wrote: I'm using the following macro to take the value in cell B2 and save each worksheet and the worksheet called "Schedule" into their own workbooks. It keeps hanging at the line that reads ".value = wks.name Any ideas how to fix this? Mike Option Explicit Sub testme() Dim wks As Worksheet For Each wks In ActiveWindow.SelectedSheets Worksheets(Array("Schedule", wks.Name)).Copy With ActiveSheet .Parent.Worksheets("Schedule").Move _ befo=.Parent.Worksheets(1) With .Parent.Worksheets(wks.Name).Range("B2") .NumberFormat = "text" .Value = wks.Name End With .Parent.SaveAs Filename:="\\bdfiler\masterads\2007 Master Ad" & wks.Name & ".xls", _ FileFormat:=xlWorkbookNormal .Parent.Close savechanges:=False End With Next wks End Sub -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Error | Excel Worksheet Functions | |||
Macro Error | Excel Discussion (Misc queries) | |||
Macro error please help | Excel Discussion (Misc queries) | |||
Macro error : Application-defined or object-defined error | Excel Discussion (Misc queries) | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) |