Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default error: "sub or function not defined" what is it trying to tell me?!

I have written the following code:

Private Sub Workbook_before close (Cancel as Boolean)

Dim D7 As String

If IsText(D7) Then
If IsEmpty(E7) Then
MsgBox "E7 is empty, please fill it"
End If

Cancel = True


End Sub

If cell D7 has text I want E7 to have text too, and if it doesn't
want the message box to pop up. I know the code that i have written i
correct, but

The problem is that it is telling me that the ISTEXT sub or function i
not defined. I am missing something but I can't figure out what it is


WHAT THE HECK IS IT TRYING TO TELL ME????!!!
I am SOOO confused and frustrated

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default error: "sub or function not defined" what is it trying to tell me?!

Hi
ISTEXT is not a VBA function. Try
application.worksheetfunction.istext

--
Regards
Frank Kabel
Frankfurt, Germany


I have written the following code:

Private Sub Workbook_before close (Cancel as Boolean)

Dim D7 As String

If IsText(D7) Then
If IsEmpty(E7) Then
MsgBox "E7 is empty, please fill it"
End If

Cancel = True


End Sub

If cell D7 has text I want E7 to have text too, and if it doesn't I
want the message box to pop up. I know the code that i have written

is
correct, but

The problem is that it is telling me that the ISTEXT sub or function
is not defined. I am missing something but I can't figure out what
it is?


WHAT THE HECK IS IT TRYING TO TELL ME????!!!
I am SOOO confused and frustrated!


---
Message posted from http://www.ExcelForum.com/


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default error: "sub or function not defined" what is it trying to tell me?!

hi,
try declaring e7 as a string also or
change both D7 and E7 to Range("D7") and Range("E7").
changing the reference and you wont have to declare either
one.
since you seem to be talking about cell addresses, i
assume you are not in a loop.

-----Original Message-----
I have written the following code:

Private Sub Workbook_before close (Cancel as Boolean)

Dim D7 As String

If IsText(D7) Then
If IsEmpty(E7) Then
MsgBox "E7 is empty, please fill it"
End If

Cancel = True


End Sub

If cell D7 has text I want E7 to have text too, and if it

doesn't I
want the message box to pop up. I know the code that i

have written is
correct, but

The problem is that it is telling me that the ISTEXT sub

or function is
not defined. I am missing something but I can't figure

out what it is?


WHAT THE HECK IS IT TRYING TO TELL ME????!!!
I am SOOO confused and frustrated!


---
Message posted from http://www.ExcelForum.com/

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default error: "sub or function not defined" what is it trying to tell me?!

The code is far from correct, but hopefully the code below will help

Private Sub Workbook_beforeclose(Cancel As Boolean)
If Worksheets("Sheet1").Range("D7").Value < "" Then
If Worksheets("Sheet1").Range("E7").Value = "" Then
MsgBox "You must fill cell E7", vbOKOnly
Cancel = True
End If
End If
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"jmorgs " wrote in message
...
I have written the following code:

Private Sub Workbook_before close (Cancel as Boolean)

Dim D7 As String

If IsText(D7) Then
If IsEmpty(E7) Then
MsgBox "E7 is empty, please fill it"
End If

Cancel = True


End Sub

If cell D7 has text I want E7 to have text too, and if it doesn't I
want the message box to pop up. I know the code that i have written is
correct, but

The problem is that it is telling me that the ISTEXT sub or function is
not defined. I am missing something but I can't figure out what it is?


WHAT THE HECK IS IT TRYING TO TELL ME????!!!
I am SOOO confused and frustrated!


---
Message posted from
http://www.ExcelForum.com/



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
Excel Message "user defined type not defined" LEELK01 Excel Discussion (Misc queries) 2 August 14th 09 07:31 AM
"Compile error: sub or function not defined" Joe Excel Discussion (Misc queries) 4 January 30th 06 08:19 PM
What does "Application-defined or object-defined error" mean? Shatin Excel Programming 4 February 3rd 04 10:15 AM
"Application-defined or object-defined error" while printing excel report chemburkar Excel Programming 0 February 2nd 04 08:33 PM
"Run Time Error 1004 Application Defined or Object Defined Error." BJC Excel Programming 4 October 26th 03 03:09 AM


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