Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 7th, 2004, 10:44 AM
Authorized User
 
Join Date: Jun 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default Getting Cell Of Function

Hello All,

I think this should be easy, but I can't seem to figure it out.

How do I get the address (or range) of the cell that is running a function?

For example, if I have a function in cell B5, how do I know that it is running in B5?

Thanks,
pagates
 
Old January 9th, 2004, 06:07 PM
Registered User
 
Join Date: Jan 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello,

If you want to get a ref to the cell where the function is calling from in your function, the ref of the cell will be returned by "Application.caller".
Be careful because all actions can't be done on the cell, for example you can't change the format of cell ie color.

Hope this will help you.

Regards.
Patdil






Similar Threads
Thread Thread Starter Forum Replies Last Post
cell is empty while using For Each cell In Range jase2007 Excel VBA 4 April 5th, 2012 10:20 PM
Using Match function retrieve cell reference not wapfu Excel VBA 2 December 11th, 2006 05:09 AM
I need to refer a cell within a cell like =RC[ RC2 chakravarthi_os Excel VBA 1 September 24th, 2006 08:19 AM
if the cell content is a part of another cell cont sriramus Excel VBA 1 November 15th, 2005 10:20 AM
Lose cell Text when editing cell in VSFlexGrid 6 bobcratchet VB How-To 0 July 30th, 2004 09:32 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.