Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Getting active cell address

Hi,

I am not an Excel VBA expert and have run into a roadblock in attempts
to create a VBA script to manipulate data in S/S cells. What I want
to do is retrieve the address of the active cell. From that I want to
get the row number so that I can go to other cell in that row to read
and modify cell values.

Reviewing all the Excel classes and help files I couldn't seem to
locate a method that returns an object that contains the currently
active cell address.

Any help would be appreciated. TIA ...

Mike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Getting active cell address


-----Original Message-----
Hi,

I am not an Excel VBA expert and have run into a

roadblock in attempts
to create a VBA script to manipulate data in S/S cells.

What I want
to do is retrieve the address of the active cell. From

that I want to
get the row number so that I can go to other cell in that

row to read
and modify cell values.

Reviewing all the Excel classes and help files I couldn't

seem to
locate a method that returns an object that contains the

currently
active cell address.

Any help would be appreciated. TIA ...

Mike
.
Hi Mike


Use the ActiveCell.Address as:
Sub ActiveCellAddress()
Dim myCellAddress As String
myCellAddress = ActiveCell.Address
MsgBox "Active cell address: " & myCellAddress
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Getting active cell address

Hi Mike

You can read the row number directly:

ActiveCell.Row

(Likewise for .Column and .Address)
--
HTH. Best wishes Harald
Followup to newsgroup only please

"bmwmcrider" skrev i melding
om...
Hi,

I am not an Excel VBA expert and have run into a roadblock in attempts
to create a VBA script to manipulate data in S/S cells. What I want
to do is retrieve the address of the active cell. From that I want to
get the row number so that I can go to other cell in that row to read
and modify cell values.

Reviewing all the Excel classes and help files I couldn't seem to
locate a method that returns an object that contains the currently
active cell address.

Any help would be appreciated. TIA ...

Mike



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Getting active cell address

Just to add to the previous answers...

You may also want to take a look at the Offset property.

Troy


Sub Test1()

'Change the cell 1 column to the right.
ActiveCell.Offset(0, 1).Value = 123

'Change the cell 2 columns to the right.
ActiveCell.Offset(0, 2) = 456

End Sub



"bmwmcrider" wrote in message
om...
Hi,

I am not an Excel VBA expert and have run into a roadblock in attempts
to create a VBA script to manipulate data in S/S cells. What I want
to do is retrieve the address of the active cell. From that I want to
get the row number so that I can go to other cell in that row to read
and modify cell values.

Reviewing all the Excel classes and help files I couldn't seem to
locate a method that returns an object that contains the currently
active cell address.

Any help would be appreciated. TIA ...

Mike



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Getting active cell address

Hi Gregas, Harald

Thanks for yor help. After going back and studying the properties
some more I too eventually figured out how to achieve my objective.

I should get a book on writing VBA scripts for Excel rather than rely
on the help pages. Any recommendations?

Mike

(bmwmcrider) wrote in message . com...

I am not an Excel VBA expert and have run into a roadblock in attempts
to create a VBA script to manipulate data in S/S cells. What I want
to do is retrieve the address of the active cell. From that I want to



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default Getting active cell address

Here is a list of books on Excel.
http://www.contextures.com/xlbooks.html

John Walkenbach has written a bunch of books. I'd frequent a bookstore
and/or library before I made a decision.

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------

I should get a book on writing VBA scripts for Excel rather than rely
on the help pages. Any recommendations?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
following the active cell address without recalc haystack Excel Worksheet Functions 3 November 13th 08 01:48 AM
How can I use the active cell address as a value mohavv Excel Discussion (Misc queries) 2 April 18th 08 06:16 AM
Get Address of Active Cell LarryL Excel Discussion (Misc queries) 3 February 16th 07 10:02 PM
Find address of active cell Dave Excel Worksheet Functions 5 September 6th 06 06:43 PM
How to get the active cell address? d Excel Programming 1 August 25th 03 04:34 PM


All times are GMT +1. The time now is 01:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"