View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Casey[_35_] Casey[_35_] is offline
external usenet poster
 
Posts: 1
Default Convert a UDF to it's value when copy sheet


Hi,
I have a UDF that places the sheet name into Cell "I3" using th
following formula:

Sheetname (A1) in "I3"

Here is the UDF:
Public Function SheetName(ref) As String
SheetName = ref.Parent.Name
End Function

I then use a routine tied to a command button to copy the sheet an
convert all formulas to there values for distribution. But the UD
formula doesn't get converted to it's value. Would appreciate any help
Here's my Copy code:
Sub CopySaveRFI()
Dim c As Range
Dim d As Range
ActiveSheet.Copy
ActiveSheet.Unprotect ("geekk")
Set d = ActiveSheet.Cells.SpecialCells(xlCellTypeFormulas)
For Each c In d
With c
.Value = .Value
End With
Next c
ActiveSheet.Protect ("geekk")
Application.Dialogs(xlDialogSaveAs).Show
End Su

--
Case

-----------------------------------------------------------------------
Casey's Profile: http://www.excelforum.com/member.php...nfo&userid=454
View this thread: http://www.excelforum.com/showthread.php?threadid=48820