Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Determine Column Number in a function

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 301
Default Determine Column Number in a function

Function ColNum() As Integer
ColNum = Application.Caller.Column
End Function

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

"cubbybear3" wrote in message
ups.com...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Determine Column Number in a function

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" wrote in message
ups.com...
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
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
Determine a result of one column based on conditions in two column tel703 Excel Discussion (Misc queries) 1 March 25th 10 05:01 PM
Function that will look at letter in a column and return a number locasciok1 Excel Worksheet Functions 4 November 11th 09 06:31 AM
inverse of the column function? i.e. input a number, output thecorresponding column text label Brotherharry Excel Worksheet Functions 19 February 14th 09 12:37 AM
How do I put a variable column number in the sum() function? BobC[_2_] Excel Worksheet Functions 8 November 23rd 08 07:17 PM
Determine start column/ end column of Merged Cell jC! Excel Programming 3 July 8th 04 12:05 PM


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