Hi folks,
I have a macro that takes info from my workbook [Client-Record.xlsm]DATA STORAGE' sheet and pastes it into my Master Books 2011 - 2012 Q1 Workbook.
However I have two issues I need help with.
Issue 1 .. [Client-Record.xlsm]DATA STORAGE doesn't get saved as Client-Record.xlsm. Therefore the macro won't work if it has been saved with a new name. I need the request for the current work book name to be flexible and check for and insert the name of the workbook.
Issue 2 ... If my Master Books 2011 - 2012 Q1 is already open my macro fails bringing up a this workbook is already open ..... error.
Can some one show me how to modify my code to allow for these two issues.
I am using excel 2010 and the macro code is below.
Hoping someone can enlighten me.
Thanks in advance
Cheers
kirk
I have a macro that takes info from my workbook [Client-Record.xlsm]DATA STORAGE' sheet and pastes it into my Master Books 2011 - 2012 Q1 Workbook.
However I have two issues I need help with.
Issue 1 .. [Client-Record.xlsm]DATA STORAGE doesn't get saved as Client-Record.xlsm. Therefore the macro won't work if it has been saved with a new name. I need the request for the current work book name to be flexible and check for and insert the name of the workbook.
Issue 2 ... If my Master Books 2011 - 2012 Q1 is already open my macro fails bringing up a this workbook is already open ..... error.
Can some one show me how to modify my code to allow for these two issues.
I am using excel 2010 and the macro code is below.
Code:
Range("F14").Select
Workbooks.Open Filename:="F:\Master Books 2011 - 2012 Q1.xlsm"
Windows.Arrange ArrangeStyle:=xlHorizontal
Windows("Client-Record.xlsm").Activate
Sheets("EDIT CLIENT").Select
Sheets("DATA STORAGE").Visible = True
Windows("Master Books 2011 - 2012 Q1.xlsm").Activate
Rows("2:2").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrBelow
Range("A2").Select
ActiveCell.FormulaR1C1 = "='[Client-Record.xlsm]DATA STORAGE'!R3C1"
Range("A2").Select
ActiveCell.FormulaR1C1 = "='[Client-Record.xlsm]DATA STORAGE'!R3C"
Range("A2").Select
Selection.AutoFill Destination:=Range("A2:AH2"), Type:=xlFillDefault
Range("A2:AH2").Select
ActiveWorkbook.Save
ActiveWindow.Close
Sheets("DATA STORAGE").Select
ActiveWindow.SelectedSheets.Visible = False
Range("B3").Select
Hoping someone can enlighten me.
Thanks in advance
Cheers
kirk