r/visualbasic • • Aug 03 '18

Help: Learning Visual Basic in Excel

Good day, anyone of you here have any recommended books or videos that helps me in learning visual basic in excel.
Purpose of wanting to learn: I need it in my work ( I mostly work with excel), and I want to learn more. There are things i want to do in excel that is not possible with common/basic excel functions (can only be done with visual basic) and i want to create my own programs in excel that will help me improve my work (and possibly be promoted, yey)
Level of VB understanding: 5/10, we had VB in highschool but i forgot most of the ideas, but I can remember them (needs refresher)

I highly appreciate your responses and I thank you in advance.
If you have any recommendations not related to VB but can help me in my work, that is highly appreciated as well.

6 Upvotes

13 comments sorted by

View all comments

2

u/raunchyfartbomb Aug 03 '18

is there anything specific you are looking to do to help us steer this advice? importing / exporting / saving and attaching to an email / or just cell manipulation?

Personally, I taught myself excel vba by looking at existing code and adapting it to my needs mostly. (I did have a logic/programming course that covered general topics in programming, but that was with C#).

One of my first projects that really got me into vba was MyLongWar, a spreadsheet meant to help people more easily customize the mods in the Xcom War Within (Long War Mod). the VB code is accessible if you were to download and attempt to view it.

that spreadsheet imports various tab-delimited text files, fills up the spreadsheet, and has a ton of functionality for modifying the config files of that game (which are just tab delimited text files). It also has userforms, so you can see how we called those up and what we did there to manipulate the spreadsheet.

1

u/pepper_clip Aug 03 '18

I am gonna be more inclined to do office works. Like making complicated payroll system(lots of deductions and bonuses and classifications of where the labor is applied to ) and other office works that has a little bit of complicated computations that needs a standard report output. I hope my description helps. I might become interested in making other applications and try other programming language if my skills will permit to do so in the future.

2

u/raunchyfartbomb Aug 03 '18

Not to discourage you, but If it’s for a mid-large company and your goal is a excel time sheet or payroll for people to fill out, there are already applications available for use for what you want to do.

That said, the VP of my company wrote our original excel time sheet (which worked, but was rudimentary and lacking ease of use. It’s primarily used for traveling personnel who don’t have daily access to be able to clock in. ). Once I got my hands on it, I really improved it quite a bit in regards to user functionality and a bit easier readout for the people that enter data into the payroll / work order systems.

My recommendation if you are going to pursue it is to have a page (or several) dedicated to the report layout, and have the code fill in data dynamically on that report (that way if additional rows for a section are needed it can done automatically in the code to only start the next section once that first section is complete.) Have all the data points on other pages and just parse the pages as needed. You will likely need to hard code some exceptions in if you are performing math based on time within the cells (because midnight of current day is 00:00 and midnight of next day is 1/1/1900 00:00)

Also, use ‘Application.ScreenUpdating = True/False’ it, it will really help with processing time by not requiring every edit to be displayed prior to working on the next cell change.

1

u/pepper_clip Aug 07 '18

Thanks for your recommendations. That helped me a lot to think about what is and should be my goal to pursue in vba and programming. I will still pursue my goal into introducing myself with programming. Not only in vba but also other language. Again, thanks.

1

u/pepper_clip Aug 03 '18

Based on your first question. It will be more on cell manipulation.