Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cell location


Hi, I am trying to build a function that returns the cell on which it i
in. For example, if I place it on A1, then it will return A1. Afte
that I want to copy and paste into the other cells and have A2, A3 an
so on. The problem is that I tried to do it with activecell and tha
does not work, since when I copy and paste the activecell is still A1.
Do you have any ideas?

Thanks

--
ehnt
-----------------------------------------------------------------------
ehntd's Profile: http://www.excelforum.com/member.php...fo&userid=1586
View this thread: http://www.excelforum.com/showthread.php?threadid=38980

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Cell location

"ehntd" wrote in message
...
Hi, I am trying to build a function that returns the cell on which it is
in. For example, if I place it on A1, then it will return A1. After
that I want to copy and paste into the other cells and have A2, A3 and
so on. The problem is that I tried to do it with activecell and that
does not work, since when I copy and paste the activecell is still A1.
Do you have any ideas?


This will work for columns A through Z and for as many rows as you want:

=CHAR(64+COLUMN()) & ROW()

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Cell location

Here is a UDF

Function WhereAmI()
WhereAmI = Application.Caller.Address(False, False)
End Function


Call with =WhereAmI()

--

HTH

RP
(remove nothere from the email address if mailing direct)


"ehntd" wrote in message
...

Hi, I am trying to build a function that returns the cell on which it is
in. For example, if I place it on A1, then it will return A1. After
that I want to copy and paste into the other cells and have A2, A3 and
so on. The problem is that I tried to do it with activecell and that
does not work, since when I copy and paste the activecell is still A1.
Do you have any ideas?

Thanks!


--
ehntd
------------------------------------------------------------------------
ehntd's Profile:

http://www.excelforum.com/member.php...o&userid=15865
View this thread: http://www.excelforum.com/showthread...hreadid=389809



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cell location


That worked great! Thanks

--
ehnt
-----------------------------------------------------------------------
ehntd's Profile: http://www.excelforum.com/member.php...fo&userid=1586
View this thread: http://www.excelforum.com/showthread.php?threadid=38980

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Cell location

Or just a worksheet function.

In A1:
=cell("address",a1)
or
=substitute(cell("address",a1),"$","")
(if you really don't want the $ signs.)

ehntd wrote:

Hi, I am trying to build a function that returns the cell on which it is
in. For example, if I place it on A1, then it will return A1. After
that I want to copy and paste into the other cells and have A2, A3 and
so on. The problem is that I tried to do it with activecell and that
does not work, since when I copy and paste the activecell is still A1.
Do you have any ideas?

Thanks!

--
ehntd
------------------------------------------------------------------------
ehntd's Profile: http://www.excelforum.com/member.php...o&userid=15865
View this thread: http://www.excelforum.com/showthread...hreadid=389809


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Cell location

WITHOUT THE USE OF A MACRO . . .

YOU CAN USE ADDRESS WITH A ROW AND COLUMN FUNCTION IMBEDDED.

=ADDRESS(ROW(),COLUMN(),4)

PASTE THAT FORMULA IN ANY CELL AND IT WILL GIVE YOU THE CELL ADDRESS.




"ehntd" wrote:


Hi, I am trying to build a function that returns the cell on which it is
in. For example, if I place it on A1, then it will return A1. After
that I want to copy and paste into the other cells and have A2, A3 and
so on. The problem is that I tried to do it with activecell and that
does not work, since when I copy and paste the activecell is still A1.
Do you have any ideas?

Thanks!


--
ehntd
------------------------------------------------------------------------
ehntd's Profile: http://www.excelforum.com/member.php...o&userid=15865
View this thread: http://www.excelforum.com/showthread...hreadid=389809


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
CELL LOCATION CONGOGRY Excel Worksheet Functions 2 August 5th 09 03:28 PM
Macro - save to current location vs excel default location leezard Excel Discussion (Misc queries) 0 October 28th 08 03:04 PM
automatic offset cell location when there is a value in a selected cell. kuansheng Excel Worksheet Functions 0 February 23rd 06 01:40 AM
location of cell owl527 Excel Worksheet Functions 8 January 24th 06 06:46 AM
Cell Location Richard Excel Discussion (Misc queries) 2 August 31st 05 08:39 PM


All times are GMT +1. The time now is 05:42 AM.

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"