I am new to macros.I want to write a macro to copy specific data in columns in MPP to another using excel.
I have found a code that will copy data from one excel to another.please help
Option Explicit
Sub CopytoPS()
Dim sfil As String
Dim owbk As Workbook
Dim sPath As String
sPath = "C:\Users\HYMC\Excel\Test\" 'Change the file path for your purposes
sfil = Dir(sPath & "Management Report PS.xls")
Range("A2:I22").Copy
Set owbk = Workbooks.Open(sPath & sfil)
owbk.Sheets("Sales Data").Range("B65536").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
owbk.Close True 'Save opened workbook and close
sfil = Dir
End Sub
I want to copy certain coloums in MPP to a set of cloumns in Excel.I also want user to just give the destination file path,source file ,source cells to be copied and destination cells
To work with MPP file in Excel, Open the VBA Editor and click References on the Tools menu. In the Available References list, click to select the Microsoft Project xx.xx Object Library check box. If the Microsoft Project 9.0 Object Library is not listed, click Browse to locate the MsprjXX.olb file, which is in the folder where you have Microsoft Project installed. The default location is C:\Program Files\Microsoft Office\Office. Click OK to close the References dialog box. Then Use this code.
Since you have not mentioned what you want to copy and where exactly, i will give you a very basic code which you can then work on.
You can visit this link which is a good start. But ultimately, it all depends on how much you practice 🙂
Topic: Record and use Excel macros
Link: http://office.microsoft.com/en-us/excel-help/record-and-use-excel-macros-HA001054837.aspx
More On Macros:
http://www.excel-vba.com/
http://www.excel-vba-easy.com/
http://www.mrexcel.com/articles.shtml