Sub testObjet()
Dim feuil1 As Worksheet
Dim y As Double
Set feuil1 = worsheets(1)
y = 127.66
feuil1.Cells(1, 1) = y
I get "Function or Sub not defined"...
thanks for your help
Printable View
Sub testObjet()
Dim feuil1 As Worksheet
Dim y As Double
Set feuil1 = worsheets(1)
y = 127.66
feuil1.Cells(1, 1) = y
I get "Function or Sub not defined"...
thanks for your help
TONS of things are wrong with it, and TBH if you can't work out what the mistakes are in that code then there is literally no hope whatsoever for you in the programming field.
If, as I suspect, it is a question asked by your tutor, there's a reason why you were asked it and not us...because YOU need to learn how to find mistakes
I'm a real beginner... and I have been searching... I know ...shame on me... but it's not my tutor just trying to understand...
Sorry about that
To start with you are opening with
SUB testObjet()
What is Sub testObjet()
That is not valid code.
Missing something at the end also
I know I sound like I'm being nasty, but jumping in at the deep end is definitely NOT the way to learn VB, esp. if you'll be an undue burden on the community here with all your questions...we don't mind answering proper questions when you're stuck with coding a program, but we do this voluntarily and someone who is going to ask as many questions as you will need to ask is soon going to get on our nerves :-P
Find a tutorial somewhere, learn the basics, and most of all TRY to work out the answer without asking us for help...if you really get stuck then come to us, and if it's in much the same circumstances as this thread then I would say programming in VB6 is *definitely* not for you!
and sometimes it's a simple spelling mistake that could easily be over looked:
worsheets(1)
should be
worksheets(1)
-tg
oh my.
Thread moved to 'Office Development/VBA' forum (note that the "VB Editor" in Office programs is actually VBA rather than VB, so the 'VB6' forum is not really apt)
loswillys, I recommend you read (and bookmark/save) the article What does this error mean, and how do I fix it? from our Classic VB FAQs (in the FAQ forum), as it gives you guidance for solving some of the more commonly seen errors.
No it shouldn't, because WorkSheets is a collection that contains WorkSheet objects.Quote:
Originally Posted by smUX
There is no implication whatsoever that loswillys has created a Collection/Array called WorkSheet
Erm.. we all have to start somewhere. Knowing everything in advance certainly isn't a pre-requisite.Quote:
Originally Posted by smUX
That is very debatable, many of us started in that way, and came out of it well.Quote:
Originally Posted by smUX
I see this kind of thing from you regularly, and it is rather rude.Quote:
esp. if you'll be an undue burden on the community here with all your questions... we don't mind answering proper questions when you're stuck with coding a program, but we do this voluntarily and someone who is going to ask as many questions as you will need to ask is soon going to get on our nerves :-P
You shouldn't make comments based on assumptions about how somebody will behave in the future based on just a couple of posts - instead you should either start by trying to push them in the right direction, or stay out of it until they improve their skills (or you have a reasonable amount of evidence to back up your assumptions).
If you want to discuss this further, feel free to PM me (or any other moderator), as we don't want to derail this thread.