VBA macro print as PDF

Excel to pdf

A very helpful VBA macro that turns any printable excel document into a PDF file. Convert excel to pdf or save excel to pdf Sub savepdf() mo= Month(Date) d = Day(Date) y = Year(Date) h = Hour(Now) m = Minute(Now) s = Second(Now) file= y & mo & d & “-” & h & m […]

Excel macro for loop

This is a tutorial for beginners to learn excel macro for loop. Loop sequences may be achieved by using a FOR block or a WHILE. Macro for loop using FOR A FOR block looks like this: For i = 1 To 100     Range(“A” & i) = “Number” & i Next i Where i is […]

Run macro on open file event

In order to run macro on open file event you need to have the VBA code (macro) inside the Workbook_Open() event in ThisWorkbook element on Project Explorer. You must first open the VBA editor in Excel and type your macro code inside the Sub Workbook_Open(). I attach a picture for you to see what I […]

Excel VBA Macro Exercise

This is a tutorial for anyone wanting to learn how to write their first excel vba macro. These macros are very useful when we need to do a lot of manual work on large data tables and these manual actions can be automated by using a macro to execute every operation that we usually did […]

Combobox VBA – populating with items

Combobox VBA

Comboboxes are user friendly data input forms that can make the difference between a quality looking form and a archaic data input screen. Defining combobox in Excel For this step you must go to the Excel Developer menu, make sure you have this menu since it doesn’t come activated in Excel Options. Select the Insert […]

Reading from SQL table in VBA Excel

Reading from SQL

Reading from SQL tables usually means that there is a need for supplementary data processing and manipulation before conclusions and information being provided to the decision making person. Excel is the best application to satisfy this need and some very useful and ergonomic reports can be developed in order to provide fresh and accurate information. […]

Excel file unsaveable

Some companies use Excel files through intranet networks for all their staff to have access to certain information and automated reports. This usually means that this kind of file should be unsavable by the staff in order to preserve a certain degree of accuracy and format. Setting Excel file as unsavable Without altering the menu […]

Connecting to SQL Server in VBA Excel

Connecting to SQLServer VBA

Building automated reports in Excel by connecting directly to an ERP database is a good shortcut to have fresh and accurate information to base your decisions on. This method facilitates data processing and manipulation in VBA before results and conclusions are displayed and a further availability for organizing, calculations and sorting after Excel tables are […]