Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formatting Excel cell through Javascript | Excel Discussion (Misc queries) | |||
link javascript | Excel Worksheet Functions | |||
link javascript | Excel Worksheet Functions | |||
Javascript Question | New Users to Excel | |||
query page with javascript | Excel Programming |