S
smr78
Hi,
I'm trying to convert VBA formulas from VBscript to Javascript. The
formulas I wrote in VBscript, find the first blank row and column in a
Worksheet (in fact, they find the last used row and column).Up to now,
I can't find the right syntax in javascript!
Here are the Vbscript routine which runs well
with excel.activeSheet.Cells
r = .Find("*", .Item(1), , , 1, 2).Row ' 1 for xlByRows, 2 for
xlPrevious
c = .Find("*", .Item(1), , , 2, 2).Column ' 2 for xlByColumns,2 for
xlPrevious
.Range(.Cells(r + 1, 1), .Cells(r + 1, c)).Select
end with
I tried these in javascript but give error :
excel.application.Worksheets("2003EC").Activate;
with (excel.application.ActiveSheet.Cells) {
r = Cells.find("*", Cells(1), , , 1, 2).Row; // 1 for xlByRows, 2 for
xlPrevious
c = Cells.find("*", Cells(1), , , 2, 2).Column; // 2 for xlByColumns,2
for xlPrevious
Range(Cells(r + 1, 1), Cells(r + 1, c)).Select;
}
Is there any Excel web site giving tips for VBA formulas translation to
Javascript (or VBscript)?
Thanks for any help
I'm trying to convert VBA formulas from VBscript to Javascript. The
formulas I wrote in VBscript, find the first blank row and column in a
Worksheet (in fact, they find the last used row and column).Up to now,
I can't find the right syntax in javascript!
Here are the Vbscript routine which runs well
with excel.activeSheet.Cells
r = .Find("*", .Item(1), , , 1, 2).Row ' 1 for xlByRows, 2 for
xlPrevious
c = .Find("*", .Item(1), , , 2, 2).Column ' 2 for xlByColumns,2 for
xlPrevious
.Range(.Cells(r + 1, 1), .Cells(r + 1, c)).Select
end with
I tried these in javascript but give error :
excel.application.Worksheets("2003EC").Activate;
with (excel.application.ActiveSheet.Cells) {
r = Cells.find("*", Cells(1), , , 1, 2).Row; // 1 for xlByRows, 2 for
xlPrevious
c = Cells.find("*", Cells(1), , , 2, 2).Column; // 2 for xlByColumns,2
for xlPrevious
Range(Cells(r + 1, 1), Cells(r + 1, c)).Select;
}
Is there any Excel web site giving tips for VBA formulas translation to
Javascript (or VBscript)?
Thanks for any help