N
N
newaitix2018-08-06 19:22:25
JavaScript
newaitix, 2018-08-06 19:22:25

Convert from javascript to VBA?

var str="{Volkswagen 2008-2017, Skoda 2008-2017, Seat 2008-2017}";
var exec=/{\w+ (\d{4}-\d{4}), \w+ (\d{4}-\d{4})/.exec(str);
var ear1=exec[1].split('-');
var ear2=exec[2].split('-');
function methodName(a){
  a[0]=Number(a[0]);
  a[1]=Number(a[1]);
  var arr=[];
  for(var i=a[0];i<a[1];i++)
    arr.push(i);
  return arr;
}
ear1=methodName(ear1);
ear2=methodName(ear2);
ear1='{'+ear1.join(' год, ')+' год}';
ear2='{'+ear2.join(' год, ')+' год}';

I have a script that needs to be converted to VBA. I don't know VBA at all, please help. It is necessary to write so that this script can be executed in excel to replace strings.
Transpoilers adequate did not find.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question