![]() |
VBA formulas in javascript
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 ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
VBA formulas in javascript
Hi,
I found part of the solution with : excel.ActiveSheet.Cells.find("*", excel.ActiveSheet.Cells(1),null ,null , 1, 2).Row I checked that VBA formulas are not case sensitive once in Javascript. Now I have to find how to select this calculated Range : Range(Cells(r+ 1, 1), Cells(r+ 1, c)).select Next post? ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
All times are GMT +1. The time now is 05:04 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com