#1   Report Post  
Posted to microsoft.public.excel.misc
Wu Wu is offline
external usenet poster
 
Posts: 36
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   Report Post  
Posted to microsoft.public.excel.misc
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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 48
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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
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
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
Stupid Question Justin Kreamer Excel Discussion (Misc queries) 1 May 2nd 08 07:47 AM
Probably a Stupid Question Paige Excel Discussion (Misc queries) 10 February 4th 08 06:52 PM
stupid question Kimberly New Users to Excel 4 May 18th 07 08:55 PM
Stupid If statement question.... Send Object Command - Two attachments Excel Discussion (Misc queries) 6 November 13th 06 03:35 PM
Stupid Question mastermind Excel Worksheet Functions 1 August 5th 06 07:03 PM


All times are GMT +1. The time now is 02:05 PM.

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

About Us

"It's about Microsoft Excel"