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

Hello,

I have an Excel spreadsheet that has a column of cells
with lots of comments. I'd like those comments in their
own field. My goal is to convert this spreadsheet to an
Access table.

In an earlier post I was told that only possible with VBA
and a user defined function with the following:

public function get_comment(rng as range)
dim res
on error resume next
res=rng.comment.text
on error goto 0
get_comment=res
end function

Then use the following formula on your worksheet:
=GET_COMMENT(A1)

Can someone descrite to me how to create the user defined
function?

Thank you in advance.

Ellen

  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default User defined functions

Hello,
I wrote too soon. The script is working beautifully!
-----Original Message-----
Hello,

I have an Excel spreadsheet that has a column of cells
with lots of comments. I'd like those comments in their
own field. My goal is to convert this spreadsheet to an
Access table.

In an earlier post I was told that only possible with VBA
and a user defined function with the following:

public function get_comment(rng as range)
dim res
on error resume next
res=rng.comment.text
on error goto 0
get_comment=res
end function

Then use the following formula on your worksheet:
=GET_COMMENT(A1)

Can someone descrite to me how to create the user defined
function?

Thank you in advance.

Ellen

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User defined functions


Here's how:

1. Open the Visual Basic Editor (from Tools menu, select Macro, the
Visual Basic Editor).
2. Hit Ctrl-R to make sure the Project Explorer window opens (it shoul
already be open). This is a window which should show the open workboo
names and the sheet names in the workbooks in tree form.
3. Right-click on the workbook you want the function in and selec
Insert -- Module.
4. Paste the code you have there.

Note that the function will only be available when the workbook is ope
(i.e. you cannot use it in another workbook). If you need to use it i
another workbook, you would put the code in your personal macr
workbook (I'll explain if you need).



--
kkkni
-----------------------------------------------------------------------
kkknie's Profile: http://www.excelforum.com/member.php...nfo&userid=754
View this thread: http://www.excelforum.com/showthread.php?threadid=26683

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
User defined functions without using VBA. [email protected] Excel Worksheet Functions 0 June 13th 06 05:49 PM
user defined functions docmurali Excel Programming 2 May 22nd 04 07:12 PM
excel functions and User defined functions Kanan Excel Programming 4 May 20th 04 11:21 PM
User Defined Functions KMcNelson Excel Programming 4 February 23rd 04 09:09 PM
User Defined Functions Ron Bishop[_2_] Excel Programming 0 November 20th 03 04:20 PM


All times are GMT +1. The time now is 02:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"