I have set up a constant as follows
Const C As String = .xlsm
Sub Open_Fies ()
Application.Run "'M_ERT Sales (P).xls'!Data_INPUT"
Windows("M_ERT Sales (P)" & "C &").Activate
I have workbook names in sheet1. I would like to run the macro "Data Export" in each of these workbooks instead of macro below. If A new file/s files are added I need to amend the macro below each time
There could be between 15 -20 workbooks on which to run the macro
Sub Export_TB() 's()...
Hi everyone, im unable to open my workbook due to the code below
Private Sub Workbook_Open()
Dim user as string
User = Inputbox ("Please type your password")
Msgbox "thank you"
I tried a lot typing albert in the inputbox but still...
I have written a macro that does various things on a workbook.
The Workbook is then saved and closed using the command ActiveWorkbook.Close SaveChanges:=True
this command was working fine until I made various changes but now it now longer works.
The last bits of my macro is as...
Dim NewFN As Variant
' Copy Invoice to a new workbook
NewFN = "C:\Users\Donny\Google Drive\Data\Invoice" & Range("B15").Value & “.xlsx”
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
I need your advice, in many vba project I have to merge several xls files into one. Im using almost always following code (below). What do you think about it? Is it efficient or maybe it could be done better and easier? I would be grateful if you could provide me examples how it will be...
Hi there folks,
its been awhile since I posted anything so if I did anything wrong please let me know.
Ok to give some background... I have a bunch of code located in an addin which opens whenever I open excel. The addin contains a custom ribbon ui with various buttons doing various things...
I have made a code that will run when opened via task scheduler. I have trusted the workbook so it doesnt prompt me for macro. My workbook open event calls the macro. After macro is complete, it closes the workbook containing the VBA. Without blocking macro's or untrusting the folder...
I have consistently used ActiveWorkbook.Close in my macros without problem to both close other workbooks and to close the workbook in which the code itself is contained. However, suddenly that function still works when it is being used to close a workbook other than the one containing the code...