Hello everyone,
I just need your help in making my macro code better to do it work like I need.
My code
Sub OPS()
Workbooks.Open ("C:\Company\" & Sheets("template").Range("B3").Value & ".xlsm")
Range("C16:O1000").copy
Windows("OPS.xlsm").Activate
Sheets("Sheet1").Select
Columns(1).SpecialCells(xlCellTypeBlanks)(1, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Workbooks.Open ("C:\Company\" & Sheets("template").Range("B3").Value & ".xlsm")
ActiveWorkbook.Close False
Sheets("Load list template").Select
End Sub
What actually does these code:
1. it has to open the file from selected folder...name of the file is in cell B3
2. select range and copy it
3. past only values in the last empty row in column A of the origin workbook - OPS.xlms
4. close the opened workbook.
What should it do?
I want that the macro stops if the file with the selected name does not exist - so if i write in B3 February (example) and file with these name does not exist in folder it displays msg box - file with these name doesn't exist and stop the macro.
To sum values in the column E of the opened workbook and displays the result in a msg box or in a cell (B4) of origin workbook.
I really don't know hot to set up the code that it will work like I want. 
Your help will be appreciated,
forfiett
Bookmarks