VBA to Javascript

Is there anybody here that is extremely good at both JavaScript and VBA?

We are moving to Google Sheets for one very large Excel workbook which has an enormous amount of VBA. But as I am not too familiar with JavaScript, I am not sure whether even some of the code can be translated from VBA to Javascript with the functions it needs to do.


What the VBA code for a macro currently does is:

It searches through all the names in first two columns of the sheet (first name in one, surname in other), and then looks for the date across from that name in another column as to which message boxes should pop up.

  • Should the date have expired (i.e. now be in the past of current day), then it displays a message box to say this - the message box also lists the individual names as well as their date
  • Should the date be expiring within the next X number of days (i.e. in the future), then it displays a message box to say this - the message box also lists the individual names as well as their date
  • Should there be no date in the column across from the names, then it displays a message box to say this - the message box also contains the individual names.
  • Should there be no issue with any of the dates (i.e. doesn’t satisfy any criteria above), then a message box pops up to say this
1 Like

if you get stuck, post your code and someone may be able to help you

2 Likes

What the VBA code for a macro currently does is:

It searches through all the names in first two columns of the sheet (first name in one, surname in other), and then looks for the date across from that name in another column as to which message boxes should pop up.

  • Should the date have expired (i.e. now be in the past of current day), then it displays a message box to say this - the message box also lists the individual names as well as their date

  • Should the date be expiring within the next X number of days (i.e. in the future), then it displays a message box to say this - the message box also lists the individual names as well as their date

  • Should there be no date in the column across from the names, then it displays a message box to say this - the message box also contains the individual names.

  • Should there be no issue with any of the dates (i.e. doesn’t satisfy any criteria above), then a message box pops up to say this

Firstly, welcome to the forums.

While we are primarily here to help people with their Free Code Camp progress, we are open to people on other paths, too. Some of what you are asking is pretty trivial in the Free Code Camp context, so you might find that if you’re not getting the instruction and material you need in your current studies, the FCC curriculum will really help you get started. At a modest guess I’d say investing a 4-5 hours working through the curriculum here will really pay off. You can find the curriculum at https://www.freecodecamp.org/learn.

With your current questions, we don’t have enough context to know what you already know or don’t know, so it is impossible to guide you without just telling you the answer (which we won’t do).

It is pretty typical on here for people to share a codepen / repl.it / jsfiddle example of what they have tried so that anyone helping has more of an idea of what help is actually helpful.

Please provide some example of what you’ve tried and I’m sure you’ll get more help.

Happy coding :slight_smile:

2 Likes

I simply don’t know much about JavaScript at all.
It will need an array of some kind, but I simply don’t know many if any of the commands it would require.

Welcome, nwa.

I have never worked with the Google Sheets API, but from what I have heard, I see no reason you would not be able to implement such using JavaScript.

As @ilenia said, we will not write/give you the code, and this is not a trivial implementation. All I can do is point you to the resources:

Otherwise, this will be quite the challenge, if you do not have much experience with JS.

Please, feel free to go do more research, and return with specific questions. Outside of specific questions, JavaScript is just a programming language; you can do almost anything with it and some moxie.

I hope this helps

2 Likes

Don’t worry, it’s clear this isn’t the place to come when you need help with something to do with JavaScript. JS is far different from VBA, so I wouldn’t even know how to start to code the answers to my questions; my question are also VERY specific as to what I would need it to do.

it is the place to come for help when you code on your own, we don’t create code for people

it seems maybe you will want to hire someone to do the job for you

1 Like

This is the place to come when you want to learn JavaScript. You have mentioned that you do not know much about JavaScript. I suggest starting with [our JavaScript Algorithms and Data Structures] lessons, so you learn more about JavaScript. If you already understand VBA, once you learn the syntax of JavaScript, you should be able to create similar functionality in JavaScript based on the original VBA code.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.