Hello evryone,
i have created an app script that i need to convert in bva macro and im no expert with excel. would anyone here help me please? the followin is the code i did on app script... basically it says any cell on column "c" that has value for example the word EXIT, then copy cell from same row column "B" and paste on column "P" and column "D" copy and paste on column "P" same row then delete those cells it was copy from these appscript has more things to it if someone can help me write it on bva macro i would really apreciated.
function onEdit(e) {
if(e.range.columnStart === 3) {
if(e.range.rowStart > 1 && e.range.rowStart < 41) {
if(e.value == 'salida') {
e.range.offset(0, 17).setValue(e.range.offset(0, -1).getValue());
e.range.offset(0, 19).setValue(e.range.offset(0, 3).getValue());
e.range.offset(0, 18).setValue(e.range.offset(0, 1).getValue());
e.range.offset(0, -1, 1, 2).clearContent();
e.range.offset(0, 3, 1, 14).clearContent();
e.range.offset(0, 1).clearContent();
e.range.offset(0, 2).clearContent();
}
}
}
if (SpreadsheetApp.getActive().getActiveSheet().getRange("e1").getValue() == 'borrar') {
var ss = SpreadsheetApp.getActiveSpreadsheet ();
ss = SpreadsheetApp.getActiveSheet().getRange("f3:f40").clearContent();
ss = SpreadsheetApp.getActiveSheet().getRange("t3:v40").clearContent();
ss = SpreadsheetApp.getActiveSheet().getRange("e1").clearContent();
}
if(e.range.columnStart === 3) {
if(e.range.rowStart > 1 && e.range.rowStart < 41) {
if(e.value == 'llegada o cambio'){
var stampCol = e.range.offset(0, 4)
if (!stampCol.getValue()) {
v = new Date()
}
stampCol.setValue(v)
}
}
}
}
i have created an app script that i need to convert in bva macro and im no expert with excel. would anyone here help me please? the followin is the code i did on app script... basically it says any cell on column "c" that has value for example the word EXIT, then copy cell from same row column "B" and paste on column "P" and column "D" copy and paste on column "P" same row then delete those cells it was copy from these appscript has more things to it if someone can help me write it on bva macro i would really apreciated.
function onEdit(e) {
if(e.range.columnStart === 3) {
if(e.range.rowStart > 1 && e.range.rowStart < 41) {
if(e.value == 'salida') {
e.range.offset(0, 17).setValue(e.range.offset(0, -1).getValue());
e.range.offset(0, 19).setValue(e.range.offset(0, 3).getValue());
e.range.offset(0, 18).setValue(e.range.offset(0, 1).getValue());
e.range.offset(0, -1, 1, 2).clearContent();
e.range.offset(0, 3, 1, 14).clearContent();
e.range.offset(0, 1).clearContent();
e.range.offset(0, 2).clearContent();
}
}
}
if (SpreadsheetApp.getActive().getActiveSheet().getRange("e1").getValue() == 'borrar') {
var ss = SpreadsheetApp.getActiveSpreadsheet ();
ss = SpreadsheetApp.getActiveSheet().getRange("f3:f40").clearContent();
ss = SpreadsheetApp.getActiveSheet().getRange("t3:v40").clearContent();
ss = SpreadsheetApp.getActiveSheet().getRange("e1").clearContent();
}
if(e.range.columnStart === 3) {
if(e.range.rowStart > 1 && e.range.rowStart < 41) {
if(e.value == 'llegada o cambio'){
var stampCol = e.range.offset(0, 4)
if (!stampCol.getValue()) {
v = new Date()
}
stampCol.setValue(v)
}
}
}
}