LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Macro works, identical Function doesn't....why?

I have the following simplified code that represents my problem. When I run
the code from the VBA editor, or run the individual macros it works
perfectly. But when I call Test() from a worksheet function the WriteIt
macro generates a #Value error and the EraseIt macro does nothing at all.
What am I doing wrong? Im useing Excel 2003.

Function Test() As Boolean

MsgBox ("Click OK to Write")
Call WriteIt
MsgBox ("Click OK to Erase")
Call EraseIt

End Function

Sub WriteIt()

Range("A1").Value = "Hello"

End Sub

Sub EraseIt()

Range("A1").ClearContents

End Sub

 
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
Can I create a macro that works like the "find' function doral Excel Discussion (Misc queries) 15 August 23rd 07 05:02 PM
LARGE function does not segregate between identical max values Dennis Excel Discussion (Misc queries) 11 July 1st 05 01:58 PM
Access connection works in Macro, not in user-defined Function Steve[_77_] Excel Programming 3 May 27th 05 02:07 PM
Inexplicable difference in row hiding speed - identical code, identical machines! Matt Larkin Excel Programming 5 November 1st 04 10:35 AM


All times are GMT +1. The time now is 11:13 AM.

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"