I wrote an Excel macro in VBA that opens a file select window, imports the selected files as new worksheets, copies the data from each worksheet recursively into a master table, prompts the user to delete the imported tables, then prompts the user to save the workbook as a new file.
Excel does have functions that achieve basically the same thing, but it was being too finicky with how it wanted the source tables formatted.
I barely know VBA and idek wtf a Boolean variable is, but I fucking did it and it’s going to make mine and my team’s life so much easier at work. That was my whole Friday lmao
I frequently have to dump a bunch of data from our accounting system, and the process afterward involves a ton of manual cutting and pasting. When I have to do it 70 times, it’s physically and mentally exhausting. I’m not the only one who has complained about this process, and nobody has done anything to make it better. So I’m fixing that shit. I’m not a programmer. I’m an accountant. But I’m also so lazy that I’ll to learn how to program a little to save myself a lot of work over the long run.
Awesome, if you have any questions, shoot. Started down that rabbit hole 20 years and never really came up for air :)
Actually it just leads to many more data type manipulation, SQL, VBA connecting to the other Microsoft app, etc. never regretted it aside from the 3am sessions trying to figure out one more thing, which leads to one more thing… But then that is the rabbit hole piece.
Btwa boolean is just data stored in a single bit, either a 1 or a 0 on the backend, but usually presented as something more obvious to the user like yes/no, true/false, on/off etc
I’d love to learn SQL. I’m going back to school later this year because I have a bachelor’s degree with 127 credit hours. I’m 23 hours shy of being eligible to hold a CPA license in my state. So I found a local community college that offers a computer science program with a focus on database management, and there’s a whole class on SQL that I’m kinda looking forward to. And because I already have a degree, all of my gen eds are out of the way. Taking the core classes for the two year degree at this community college sits right at the intersection of 151 hours. All I have to do after that is pass the CPA Exam lol It’s that easy.
Ha, cpa exam being easy aside, the biggest hurdle with sql is finding data handling interesting which you seem to be in the right position for. Good luck on your journey and feel free to ping for any questions or just to chat
Just to give you another rabbit hole, you can also manipulate pretty much any data source, including Excel using powershell. I regularly use powershell scripts to mass import data that the script processes into an Excel workbook that the powershell formats. I find powershell to be faster doing this (if you use .net framework/LINQ, powershell sucks at large scale data object processing natively), especially if it’s large amounts of data, I typically process combined logs of over a million rows.
So I had tried using the data import wizard or whatever it was that’s built in to pull an entire folder into the workbook, but I had roughly 70 workbooks, all with 40 columns and anywhere from 3,000 to 20,000 rows. At the end of it all, I probably had over 20 million cells. The built-in tool was being finicky. I think it was that the sheer amount of data I was working with was too much for it to handle. But it kept giving me errors about formatting.
So I gave up on it, and I spent several hours of my life reading manuals and forum posts on how best to achieve one step and testing code on backups. It was truly an all-day thing. But when you’re dealing with dozens of files, this macro takes maybe 45 seconds to do its thing whereas the manual process could waste an hour of your day. And I plan to share it with the team once I get it a bit more polished because it’s not exactly where I want it. But I think the rest of my colleagues will love it.
I know a little VBA. I spent a whole weekend writing a macro because I did my personal budgets in Excel, and I wanted to automate some stuff because I could conceptualize how it could be done. I don’t use Windows at home anymore so I want to figure out how to bring it over to LibreOffice Basic. Still, since the business world uses Microsoft products, knowing VBA is a much more marketable skill so it is useful to practice in VBA whenever I can.
I wrote an Excel macro in VBA that opens a file select window, imports the selected files as new worksheets, copies the data from each worksheet recursively into a master table, prompts the user to delete the imported tables, then prompts the user to save the workbook as a new file.
Excel does have functions that achieve basically the same thing, but it was being too finicky with how it wanted the source tables formatted.
I barely know VBA and idek wtf a Boolean variable is, but I fucking did it and it’s going to make mine and my team’s life so much easier at work. That was my whole Friday lmao
I frequently have to dump a bunch of data from our accounting system, and the process afterward involves a ton of manual cutting and pasting. When I have to do it 70 times, it’s physically and mentally exhausting. I’m not the only one who has complained about this process, and nobody has done anything to make it better. So I’m fixing that shit. I’m not a programmer. I’m an accountant. But I’m also so lazy that I’ll to learn how to program a little to save myself a lot of work over the long run.
Programming is a tool, you don’t have to be a knife enthusiast to want get the correct knife
Awesome, if you have any questions, shoot. Started down that rabbit hole 20 years and never really came up for air :)
Actually it just leads to many more data type manipulation, SQL, VBA connecting to the other Microsoft app, etc. never regretted it aside from the 3am sessions trying to figure out one more thing, which leads to one more thing… But then that is the rabbit hole piece.
Btwa boolean is just data stored in a single bit, either a 1 or a 0 on the backend, but usually presented as something more obvious to the user like yes/no, true/false, on/off etc
I’m interested in SQL. I just need to learn SQL.
Being interested is the most important part :)
I’d love to learn SQL. I’m going back to school later this year because I have a bachelor’s degree with 127 credit hours. I’m 23 hours shy of being eligible to hold a CPA license in my state. So I found a local community college that offers a computer science program with a focus on database management, and there’s a whole class on SQL that I’m kinda looking forward to. And because I already have a degree, all of my gen eds are out of the way. Taking the core classes for the two year degree at this community college sits right at the intersection of 151 hours. All I have to do after that is pass the CPA Exam lol It’s that easy.
Ha, cpa exam being easy aside, the biggest hurdle with sql is finding data handling interesting which you seem to be in the right position for. Good luck on your journey and feel free to ping for any questions or just to chat
Just to give you another rabbit hole, you can also manipulate pretty much any data source, including Excel using powershell. I regularly use powershell scripts to mass import data that the script processes into an Excel workbook that the powershell formats. I find powershell to be faster doing this (if you use .net framework/LINQ, powershell sucks at large scale data object processing natively), especially if it’s large amounts of data, I typically process combined logs of over a million rows.
What’s the advantage of VBA in this use case over other options?
They said they barely know vba. So it’s probably the integration into MS tools.
So I had tried using the data import wizard or whatever it was that’s built in to pull an entire folder into the workbook, but I had roughly 70 workbooks, all with 40 columns and anywhere from 3,000 to 20,000 rows. At the end of it all, I probably had over 20 million cells. The built-in tool was being finicky. I think it was that the sheer amount of data I was working with was too much for it to handle. But it kept giving me errors about formatting.
So I gave up on it, and I spent several hours of my life reading manuals and forum posts on how best to achieve one step and testing code on backups. It was truly an all-day thing. But when you’re dealing with dozens of files, this macro takes maybe 45 seconds to do its thing whereas the manual process could waste an hour of your day. And I plan to share it with the team once I get it a bit more polished because it’s not exactly where I want it. But I think the rest of my colleagues will love it.
I know a little VBA. I spent a whole weekend writing a macro because I did my personal budgets in Excel, and I wanted to automate some stuff because I could conceptualize how it could be done. I don’t use Windows at home anymore so I want to figure out how to bring it over to LibreOffice Basic. Still, since the business world uses Microsoft products, knowing VBA is a much more marketable skill so it is useful to practice in VBA whenever I can.