'User-defined type not defined'

B

Bhuktar S

I have used excel control on a form in Excel VBA.
I want to add 'If...then statement' for a cell of this spreadsheet.
When I select Spreadsheet1 from the form click, a MS VB message pops u
as 'User-defined type not defined'.
What should I do
 
B

Bhuktar S

Please see the attached file.
I wanted to add statement for the Spreadsheet1 change as
' If cells(6,3)>0 then
Cells(7,3)=0
End If'

The help from VB is beyond my understanding, so I will need everythin
that I should do.

Thanks in advance

Attachment filename: user-defined type not defined.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=54657
 
M

mudraker

Try

If sheets("Sheet1").cells(4,2).value > 0.98 then
YOUR CODE HERE
else
your code here
end i
 
B

Bhuktar S

Hello,
May be I have not made you understand properly.
I have put control 'Microsoft Office Spreadsheet 9.0' from Tools men
Additional Controls.
When I double click this control on the form, instead of opening
window for writing code, the message appears.
Please see my file attached in the previous mail.
The message is asking to define the type. The Help button on th
message opens the requred help to overcome this problem, but the metho
explained is beyond my understanding.
How do I overcome this problem such that I can write code for th
control
 
F

Frank Kabel

Hi
most people (like me) won't open attachments. Especially if they
contain macro code. So please copy the code out of your file and post
it as plain text.
 
B

Bhuktar S

Hi,
It is not the code I am talking about. It is the message what I a
talking about, which I get when I click the control on the form.
The file contains screen capture of what I get message & what ar
displays in addition to text copied from the Help of VBE. So I canno
paste it here.
(I am working in an international company and the file is made & save
in the computer owned by the company. All the files which we send o
receive are through office server & scanned. So, may be this will mak
you feel safe to open the file. If not, I do not have any other metho
to explain to you. Else, may I forget this forum?
 
F

Frank Kabel

Hi
what sould 'spreadsheet1' be?. First you said you only wnat to add and
'Iff.Then' statement. Spreatsheet1 has to be a user defined type. So
you may please explain exactly what you're trying to achieve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top