PC Review


Reply
 
 
=?Utf-8?B?UGFpZ2U=?=
Guest
Posts: n/a
 
      9th May 2007
I have a UDF that have tried to add to my Personal.xls, so it will be
available as needed. (It works fine if I put the code in a normal workbook.)
It is in a regular module in my Personal.xls VBA project. After researching
thought it had to do with needing to add a reference to Personal.xls; when I
try to do that via Tools/References/Browse and select Personal.xls it adds
'VBAProject' to the list of references with a checkmark, but then says that
the name conflicts with an existing module, project or object library and
removes it. Am confused about what I'm doing wrong here. Any advice please?
 
Reply With Quote
 
 
 
 
JW
Guest
Posts: n/a
 
      9th May 2007
It should work fine in your Personal.xls workbook. It could have to
do with the code in the UDF. If you are referencing something like
ThisWorkbook, then it is trying to apply the UDF to the Personal.xls
workbook, which would be incorrect. Could you post up the UDF code?

Paige wrote:
> I have a UDF that have tried to add to my Personal.xls, so it will be
> available as needed. (It works fine if I put the code in a normal workbook.)
> It is in a regular module in my Personal.xls VBA project. After researching
> thought it had to do with needing to add a reference to Personal.xls; when I
> try to do that via Tools/References/Browse and select Personal.xls it adds
> 'VBAProject' to the list of references with a checkmark, but then says that
> the name conflicts with an existing module, project or object library and
> removes it. Am confused about what I'm doing wrong here. Any advice please?


 
Reply With Quote
 
=?Utf-8?B?UGFpZ2U=?=
Guest
Posts: n/a
 
      9th May 2007
Thanks, JW; here is the code:

Option Explicit
Function SumColor(rColor As Range, rSumRange As Range)
'Sums cells based on a specified fill color
'Formula: =sumcolor(cell with desired color to sum,range to sum)

Application.Volatile True

Dim rCell As Range
Dim iCol As Integer
Dim vResult As Single

iCol = rColor.Interior.ColorIndex

For Each rCell In rSumRange
If rCell.Interior.ColorIndex = iCol Then
vResult = WorksheetFunction.Sum(rCell) + vResult
End If
Next rCell

SumColor = vResult
End Function

"JW" wrote:

> It should work fine in your Personal.xls workbook. It could have to
> do with the code in the UDF. If you are referencing something like
> ThisWorkbook, then it is trying to apply the UDF to the Personal.xls
> workbook, which would be incorrect. Could you post up the UDF code?
>
> Paige wrote:
> > I have a UDF that have tried to add to my Personal.xls, so it will be
> > available as needed. (It works fine if I put the code in a normal workbook.)
> > It is in a regular module in my Personal.xls VBA project. After researching
> > thought it had to do with needing to add a reference to Personal.xls; when I
> > try to do that via Tools/References/Browse and select Personal.xls it adds
> > 'VBAProject' to the list of references with a checkmark, but then says that
> > the name conflicts with an existing module, project or object library and
> > removes it. Am confused about what I'm doing wrong here. Any advice please?

>
>

 
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
Adding custom list and text boxes to the custom tool bar from Excel C API Mousam Microsoft Excel Discussion 2 8th Aug 2007 07:54 PM
How to create custom profiles for windows Movie Maker(with custom bitrate, FPS, resolution) mistral Windows XP MovieMaker 2 5th Jan 2007 05:50 PM
Programmaticly load a custom UserControl with in a custom class which implements an ITemplate LaptopHeaven Microsoft ASP .NET 0 5th Oct 2006 01:36 PM
Outlook 2003: TreeView with custom Tooltips on custom post form Urs Ruefenacht Microsoft Outlook Form Programming 0 26th Jan 2005 01:10 PM
custom message form recieved without custom fields - outlook 2000 motiv8d Microsoft Outlook Form Programming 0 5th Mar 2004 01:00 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:03 AM.