Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
oscar
 
Posts: n/a
Default Get cell address from macro function argument

Is it possible to know the address of the cell that is passed as argument to
a macro function? I want to know this to compare to the cell next to the one
passed to the function.
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Gary''s Student
 
Posts: n/a
Default Get cell address from macro function argument

Yes:

Function qwerty(r As Range) As Integer
MsgBox (r.Offset(0, 1).Address)
qwerty = 0
End Function



--
Gary's Student


"oscar" wrote:

Is it possible to know the address of the cell that is passed as argument to
a macro function? I want to know this to compare to the cell next to the one
passed to the function.

  #3   Report Post  
Posted to microsoft.public.excel.newusers
oscar
 
Posts: n/a
Default Get cell address from macro function argument

Thank you for your reply.

Is it possible to use that macro in the formula bar?
I tryed with =qwerty(A1) and I got #NAME?

Thank you for your time

"Gary''s Student" wrote:

Yes:

Function qwerty(r As Range) As Integer
MsgBox (r.Offset(0, 1).Address)
qwerty = 0
End Function



--
Gary's Student


"oscar" wrote:

Is it possible to know the address of the cell that is passed as argument to
a macro function? I want to know this to compare to the cell next to the one
passed to the function.

  #4   Report Post  
Posted to microsoft.public.excel.newusers
Gary''s Student
 
Posts: n/a
Default Get cell address from macro function argument

Yes you can.

First you need to copy the 4 line function and paste it in VBA editor. See:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Gary's Student


"oscar" wrote:

Thank you for your reply.

Is it possible to use that macro in the formula bar?
I tryed with =qwerty(A1) and I got #NAME?

Thank you for your time

"Gary''s Student" wrote:

Yes:

Function qwerty(r As Range) As Integer
MsgBox (r.Offset(0, 1).Address)
qwerty = 0
End Function



--
Gary's Student


"oscar" wrote:

Is it possible to know the address of the cell that is passed as argument to
a macro function? I want to know this to compare to the cell next to the one
passed to the function.

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
Custom functions calculating time arguments Help Desperate Bill_De Excel Worksheet Functions 12 April 25th 06 02:22 AM
Row Expansion Susan Excel Worksheet Functions 11 February 28th 06 07:15 PM
Function that Returns address of that cell? RayWolfDog Excel Worksheet Functions 2 February 15th 06 04:54 PM
ADDRESS function - dynamic input cell claytorm Excel Discussion (Misc queries) 1 June 28th 05 02:05 PM
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM


All times are GMT +1. The time now is 10:20 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"