A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

big stupid question



 
 
Thread Tools Display Modes
  #1  
Old May 17th, 2008, 06:09 AM posted to microsoft.public.excel.misc
Wu
external usenet poster
 
Posts: 41
Default big stupid question

In a marco,
If I write --- EN = cells(1,1)
then, EN will equal to the data of cells(1,1)

The problem is :
The cursor will stop at different cell, not certain.
May be at cells(2,2), cells(3,10), cells(10,2)............., every time is
different.
So, I want to get the location of the cell, then set EN is equal to that cell.

How to write in marco to get the location of cells.
  #2  
Old May 17th, 2008, 07:16 AM posted to microsoft.public.excel.misc
Rick Rothstein \(MVP - VB\)[_468_]
external usenet poster
 
Posts: 1
Default big stupid question

Try...

EN = ActiveCell.Value

Rick


"Wu" wrote in message
...
In a marco,
If I write --- EN = cells(1,1)
then, EN will equal to the data of cells(1,1)

The problem is :
The cursor will stop at different cell, not certain.
May be at cells(2,2), cells(3,10), cells(10,2)............., every time is
different.
So, I want to get the location of the cell, then set EN is equal to that
cell.

How to write in marco to get the location of cells.


  #3  
Old May 17th, 2008, 04:43 PM posted to microsoft.public.excel.misc
Gord Dibben
external usenet poster
 
Posts: 20,252
Default big stupid question

If you want the location(address)

Sub goop()
EN = ActiveCell.Address
'MsgBox "address is " & EN
End Sub

Otherwise, see Rick's reply for returning the value.


Gord Dibben MS Excel MVP

On Fri, 16 May 2008 22:09:00 -0700, Wu wrote:

In a marco,
If I write --- EN = cells(1,1)
then, EN will equal to the data of cells(1,1)

The problem is :
The cursor will stop at different cell, not certain.
May be at cells(2,2), cells(3,10), cells(10,2)............., every time is
different.
So, I want to get the location of the cell, then set EN is equal to that cell.

How to write in marco to get the location of cells.


  #4  
Old May 17th, 2008, 05:15 PM posted to microsoft.public.excel.misc
dksaluki
external usenet poster
 
Posts: 32
Default big stupid question

Are you looking for a certain value, and then you'd like to get the
address of that cell? "...cursor will stop at different cell, not
certain..."
Or are you just wanting the address of whatever cell is active at the
time?

If you're looking for something, and then would like to get the
address of that cell, you will need a Cells.Find(.......) function.
Then you could make an if statement to display cell address.

Dim mySearch as Range

On Error Resume Next
Set mySearch = Cells.Find("____")

If mySearch.Value = _____ Then
MsgBox (mySearch.Address)
End If

.....something to that effect. Have to debug a little better, but
that's basically it.

dk
  #5  
Old May 17th, 2008, 05:33 PM posted to microsoft.public.excel.misc
Dave Peterson
external usenet poster
 
Posts: 19,791
Default big stupid question

Check one of your other posts, too.

Wu wrote:

In a marco,
If I write --- EN = cells(1,1)
then, EN will equal to the data of cells(1,1)

The problem is :
The cursor will stop at different cell, not certain.
May be at cells(2,2), cells(3,10), cells(10,2)............., every time is
different.
So, I want to get the location of the cell, then set EN is equal to that cell.

How to write in marco to get the location of cells.


--

Dave Peterson
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:50 PM.


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