I am new to VBA and have experienced has been so good until now, that I am stock with something I was asked that I don't handle and haven't learned well yet.
I am giving some information to give you a better view of what my situation is and hopefully understand what I am doing.
What I am doing is the following, I am using a master file that opens two workbooks, the first one is data that needs to be cleared and prepared to fill out the second workbook which is a template (.csv) that would be uploaded to SAP.
The idea is to have all codes in the master file so that by pressing its buttons all actions needed can be completed, but I can't complete the last part which is saving the file as the specific name I want using a path in the master file. It throws me an error: This is what I've got:
'Pasting Data in CVC Template
Workbooks("CVC_Weekly AMS.csv").Activate
Range("E3").Select
ActiveSheet.Paste
'Saving Data as:
If Range("B4") = "C:\" Then
path = Range("B4")
Else
path = Range("B4") + "\"
End If
filename = InputBox("Type in the name to save this file - Recommended name CVC_Weekly AMS Current Date ")
ActiveWorkbook.SaveAs path & filename, FileFormat:=6 '6 .csv format
It seems that the code indicates to use the range in the template file instead of using the master file, the thing is that, if I add another code such as windows(masterfile) or workbooks (masterfile).activate, it saves the master file using the name I entered in the input box.
Can some one give me a hand with this? this is getting me frustrated!