I recorded a macro and successfully came up with this: However, two of the file names change daily to reflect the date.. So I am not sure if this will work tomm when the file's name has been changed.
Any help is appreciated. Thank you.. I am basically opening up files off a shared drive and copying the values into a given spreadsheet..if there is a simpler process than the below to achieve it that would be great. But it works fine as of n
Sub BrokerFiles()
'
' BrokerFiles Macro
' Grab Files from G and paste into respective columns
'
' Keyboard Shortcut: Ctrl+Shift+A
'
ChDir "G:\RDA\Convertible Models\Broker Files"
Workbooks.Open filename:= _
"G:\RDA\Convertible Models\Broker Files\CVG_PriceComp_07232012.xls"
Application.Run "wkbModel.wb_Activate"
Application.Run "GetToolbarButtonsStatus"
Application.Run "wb_Open"
Columns("A:N").Select
Selection.Copy
Windows("Convert Pricing_singh031802.xls").Activate
Application.Run "wkbModel.wb_Activate"
Application.Run "GetToolbarButtonsStatus"
Sheets("Barclays").Select
Columns("A:N").Select
Range("A136").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("CVG_PriceComp_07232012.xls").Activate
ActiveWindow.Close
Application.Run "wkbModel.wb_Activate"
Application.Run "GetToolbarButtonsStatus"
Application.Run "GetToolbarButtonsStatus"
Application.Run "wkbModel.wb_Activate"
Application.Run "GetToolbarButtonsStatus"
Workbooks.Open filename:="G:\RDA\Convertible Models\Broker Files\1 (9).xls"
Application.Run "wkbModel.wb_Activate"
Application.Run "GetToolbarButtonsStatus"
Application.Run "wb_Open"
Columns("A:H").Select
Selection.Copy
Windows("Convert Pricing_singh031802.xls").Activate
Application.Run "wkbModel.wb_Activate"
Application.Run "GetToolbarButtonsStatus"
Sheets("FBR").Select
Columns("A:H").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("1 (9).xls").Activate
ActiveWindow.Close
Application.Run "wkbModel.wb_Activate"
Application.Run "GetToolbarButtonsStatus"
Application.Run "GetToolbarButtonsStatus"
Application.Run "wkbModel.wb_Activate"
Application.Run "GetToolbarButtonsStatus"
Workbooks.Open filename:= _
"G:\RDA\Convertible Models\Broker Files\GMI 07232012.xls"
Application.Run "wkbModel.wb_Activate"
Application.Run "GetToolbarButtonsStatus"
Application.Run "wb_Open"
Columns("B:B").ColumnWidth = 12.43
Columns("B:B").ColumnWidth = 17.57
ActiveWindow.SmallScroll Down:=-30
Columns("A:J").Select
Selection.Copy
Windows("Convert Pricing_singh031802.xls").Activate
Application.Run "wkbModel.wb_Activate"
Application.Run "GetToolbarButtonsStatus"
Sheets("ML").Select
Columns("B:K").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("GMI 07232012.xls").Activate
ActiveWindow.Close
Application.Run "wkbModel.wb_Activate"
Application.Run "GetToolbarButtonsStatus"
Application.Run "GetToolbarButtonsStatus"
Application.Run "wkbModel.wb_Activate"
Application.Run "GetToolbarButtonsStatus"
End Sub
Bookmarks