Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - retrieve Active cell "Name" vbscript

Reply
 
Old 02-19-2009   #1 (permalink)
Lee


 
 

retrieve Active cell "Name" vbscript

I'm not sure if this is the right group or not,

I have a vbscript that opens and excel spreadsheet and does some work on it.

I need to be able to add a formula to a cell like "=A1+A2" , but I need to
know which cell I am in in order to add the formula

I know objXL.activeSheet.Range("A1").activate will point me to cell "A1".
then I move down through the sheet. using
objXL.activecell.offset(1,0).activate which moves me down a row,

what I really need is a way to find out "where I am" after the script moves.

is there a function that will return "B1" when I'm on the second row?



My System SpecsSystem Spec
Old 02-19-2009   #2 (permalink)
Pegasus \(MVP\)


 
 

Re: retrieve Active cell "Name" vbscript


"Lee" <ldspmAT@xxxxxx> wrote in message
news:CC862426-BB4B-42C0-8866-EECDCEEF7DCA@xxxxxx
Quote:

> I'm not sure if this is the right group or not,
>
> I have a vbscript that opens and excel spreadsheet and does some work on
> it.
>
> I need to be able to add a formula to a cell like "=A1+A2" , but I need to
> know which cell I am in in order to add the formula
>
> I know objXL.activeSheet.Range("A1").activate will point me to cell
> "A1".
> then I move down through the sheet. using
> objXL.activecell.offset(1,0).activate which moves me down a row,
>
> what I really need is a way to find out "where I am" after the script
> moves.
>
> is there a function that will return "B1" when I'm on the second row?
>
If I recall correctly then objExcel.ActiveCell.Address will return the
current cell address.


My System SpecsSystem Spec
Old 02-19-2009   #3 (permalink)
Chip Pearson


 
 

Re: retrieve Active cell "Name" vbscript

ActiveCell refers to the current active cell, wherever it might be.
ActiveCell.Address returns a string containing the address of the
ActiveCell.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)

On Thu, 19 Feb 2009 10:24:17 -0500, "Lee" <ldspmAT@xxxxxx>
wrote:
Quote:

>I'm not sure if this is the right group or not,
>
>I have a vbscript that opens and excel spreadsheet and does some work on it.
>
>I need to be able to add a formula to a cell like "=A1+A2" , but I need to
>know which cell I am in in order to add the formula
>
>I know objXL.activeSheet.Range("A1").activate will point me to cell "A1".
>then I move down through the sheet. using
>objXL.activecell.offset(1,0).activate which moves me down a row,
>
>what I really need is a way to find out "where I am" after the script moves.
>
>is there a function that will return "B1" when I'm on the second row?
>
My System SpecsSystem Spec
Old 02-19-2009   #4 (permalink)
Lee


 
 

Re: retrieve Active cell "Name" vbscript

perfect.
thanks..

I

"Pegasus (MVP)" <I.can@xxxxxx> wrote in message
news:OtzergqkJHA.5124@xxxxxx
Quote:

>
> "Lee" <ldspmAT@xxxxxx> wrote in message
> news:CC862426-BB4B-42C0-8866-EECDCEEF7DCA@xxxxxx
Quote:

>> I'm not sure if this is the right group or not,
>>
>> I have a vbscript that opens and excel spreadsheet and does some work on
>> it.
>>
>> I need to be able to add a formula to a cell like "=A1+A2" , but I need
>> to know which cell I am in in order to add the formula
>>
>> I know objXL.activeSheet.Range("A1").activate will point me to cell
>> "A1".
>> then I move down through the sheet. using
>> objXL.activecell.offset(1,0).activate which moves me down a row,
>>
>> what I really need is a way to find out "where I am" after the script
>> moves.
>>
>> is there a function that will return "B1" when I'm on the second row?
>>
>
> If I recall correctly then objExcel.ActiveCell.Address will return the
> current cell address.
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Query length Limitations on Win2K Using "ADO" "Active Directory Provider" ... Error -2147217900 VB Script
"ViewEntireForest": "Active Directory operation failed on . Thesupplied credential for PowerShell
VBScript to Change only "maximum password age" in Local User Accou VB Script
Active "sync" should be renamed Active "Stinks" Vista General
[VBScript](Set objUser = GetObject("WinNT://" & strComputer)) -eq [Powershell]? PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46