thunder_anger
Board Regular
- Joined
- Sep 27, 2009
- Messages
- 206
Hi all
I know that i ask alot of questions here in the forum but what can i do, I am still learning
anyway
all i am to do is to export my data to another work book and that book will take the name stored in Range("S7")
and want to copy and past data to this work book as values anformats "there is alot of merged cells"
i recorded a macro and edited it but it stoped in the high lighted part below
any ideas
I know that i ask alot of questions here in the forum but what can i do, I am still learning
anyway
all i am to do is to export my data to another work book and that book will take the name stored in Range("S7")
and want to copy and past data to this work book as values anformats "there is alot of merged cells"
i recorded a macro and edited it but it stoped in the high lighted part below
Code:
Sub Macro1()
'
' Macro1 Macro
'
Dim mybook As Workbook
Workbooks.Add
Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
Sheets("Sheet1").Activate
Application.CutCopyMode = False
ActiveSheet.DisplayRightToLeft = False
Sheets("Sheet1").Select
ActiveWorkbook.SaveAs Filename:="c:\" & Workbooks("Acceptance 1.xlsm").Sheets("production Parameters").Range("S7").Value & ".xlsx"
[B][COLOR=Red] Set mybook = Workbooks("Acceptance 1.xlsm").Sheets("production Parameters").Range("S7").Value & ".xlsx"[/COLOR][/B]
Windows("Acceptance 1.xlsm").Activate
Sheets("Production Parameters").Select
Range("B1:U28").Select
Selection.Copy
mybook.Activate
ActiveSheet.Paste
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "Productio parameters"
Sheets("Sheet2").Select
Windows("Acceptance 1.xlsm").Activate
Sheets("Material Report").Select
Range("A1:E22").Select
Application.CutCopyMode = False
Selection.Copy
mybook.Activate
ActiveSheet.Paste
Columns("E:E").EntireColumn.AutoFit
Columns("D:D").EntireColumn.AutoFit
Columns("B:B").EntireColumn.AutoFit
Columns("C:C").EntireColumn.AutoFit
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "Material Report"
Sheets("Sheet3").Select
Windows("Acceptance 1.xlsm").Activate
Sheets("Costs Report").Select
Range("C3:F27").Select
Application.CutCopyMode = False
Selection.Copy
mybook.Activate
ActiveSheet.Paste
Columns("A:D").Select
Columns("A:D").EntireColumn.AutoFit
Sheets("Sheet3").Select
Sheets("Sheet3").Name = "Costs Report"
Sheets("Productio parameters").Select
Application.CutCopyMode = False
ActiveWorkbook.Save
ActiveWindow.Close
Sheets("Data Entry").Select
End Sub
any ideas