PC Review


Reply
Thread Tools Rate Thread

Determine Column Number in a function

 
 
cubbybear3
Guest
Posts: n/a
 
      6th Aug 2007
I have a function that needs to know the column number/letter of the
cell calling it. How does a novice like myself do this? Thanks. -
pb

 
Reply With Quote
 
 
 
 
Bob Umlas
Guest
Posts: n/a
 
      6th Aug 2007
Function ColNum() As Integer
ColNum = Application.Caller.Column
End Function

Just enter =ColNum() in a cell.
However, =COLUMN() does that already!

"cubbybear3" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have a function that needs to know the column number/letter of the
> cell calling it. How does a novice like myself do this? Thanks. -
> pb
>



 
Reply With Quote
 
Ronald Dodge
Guest
Posts: n/a
 
      6th Aug 2007
Here's an example of the Caller Property you would use on the application
within the custom function.

Dim v as StringSelect Case TypeName(Application.Caller)
Case "Range"
v = CStr(Application.Caller.Column)
Case Else
v = "unknown"
End Select
MsgBox "Column number calling this function is " & v & "."-- Sincerely,
Ronald R. Dodge, Jr.
Master MOUS 2000

"cubbybear3" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have a function that needs to know the column number/letter of the
> cell calling it. How does a novice like myself do this? Thanks. -
> pb
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
function - find first number in row > 0, return cell column number cate Microsoft Excel Programming 3 19th Apr 2011 09:44 PM
R: Re: function - find first number in row > 0, return cell column number r Microsoft Excel Programming 0 19th Apr 2011 09:44 PM
inverse of the column function? i.e. input a number, output thecorresponding column text label Brotherharry Microsoft Excel Worksheet Functions 19 14th Feb 2009 12:37 AM
How do I determine a Function's callling Row Number. Mac Lingo Microsoft Excel Programming 2 26th Aug 2004 02:00 PM
Function to determine number of months Bridget Stacy Microsoft Excel Worksheet Functions 1 21st Jan 2004 01:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:45 PM.