How can I convert an Excel Macro to html or use the database in a webpage?
I am pretty decent with HTML+CSS (and I have used JavaScript and PHP with lots of google support) but recently I have been taught how to make Excel Macros at work (essentially alot of vlookups, format tables, and pulling data from web sources). What I want to be able to do is place the data/table online for others to use while continuing to pull data from my sources. Any ideas, tips, or how to’s?
Observing members:
0
Composing members:
0
6 Answers
Edit the macros and you will see Visual Basic (VB). ASP.NET pages. can use VB (and other languages).
One thing about Microsoft technologies – they provide huge amounts of free learning and support. Microsoft Virtual Academy has lots of online courses if you want to learn ASP.NET
For a quick intro, I would check out W3 Schools tutorials.
There are ways to do what you describe, but honestly if you’re already ok with the web technologies you mention, a better solution is probably to build something purely web based and just use your Excel sheet as a guide.
The basics of what you’re doing (as I understand it)
– pulling information from the web
– storing data
– processing that data somehow
– displaying results so they’re easy to digest
Those are all simpler without Excel involved. PHP and MySQL are buddies since way back. There are literally thousands of good tutorials how to create a simple database driven PHP application.
DataTables is a really easy way to get some powerful display tools as well. Here is a PHP/MySQL example from them as well. All the tools there have pretty good documentation and are in wide use, so you can find lots of support.
As a bonus, you’re picking up a lot of tools for developing just about anything and can go beyond what Excel would be capable of.
Hope it helps and good luck with the project.
Response moderated (Spam)
I wanted to say fundaddy’s solution is better than mine for most situations.
Excel is extremely powerful with it’s built-in VBA scripting, but it’s suited to tasks where your import/export targets are Excel/text/whatever files rather than display in a browser.
Though you could add a step in your VBA to export a static HTML file.
But for the browser, it would be best to go with browser-specific tools.
And I think PHP/MySQL skills are in demand more than ASP.NET. What you learn on this project will be valuable in the future.
Thanks for the suggestion!
If I do a “save as webpage” and it makes just the spreadsheet into an html file (none of the web sources, or sorting tabs), could I then use php/mySQL to do those features? Or should I just skip the excel step?
I haven’t done it in a while, and the new version may act differently, but I recall Save as HTML gave a really crazy mess of code, with things like a new <font> tag for every single cell (even though they were all in the same font).
Off the top of my head, if you’re exporting from Excel, I’m thinking a plain text file, comma- or tab-delimited, would be much easier to manipulate.
Answer this question
This question is in the General Section. Responses must be helpful and on-topic.