Starsurfer 01-27-2005, 03:35 PM Hi there guys, I have another excel coursework problem and I am looking for help. I have an activate clause that I want to work only once, how would I do this?
The second problem I have is that I have a data entry form, now depending on the month I put in, when i click the submit button the data i have inputted show carry over to the worksheet of that month, and then enter the data into the correct columnsand into hte first free row, how would I do this? I have not got a clue.
What I have done so far is attached
NateO 01-27-2005, 03:56 PM Hello, welcome to the board. :)
Hi there guys, I have another excel coursework problem and I am looking for help. I have an activate clause that I want to work only once, how would I do this?
What's a one-time activate clause? :confused: Can you provide some more detail of what you're asking about in ordinary terms?
The second problem I have is that I have a data entry form, now depending on the month I put in, when i click the submit button the data i have inputted show carry over to the worksheet of that month, and then enter the data into the correct columnsand into hte first free row, how would I do this? I have not got a clue.
What I have done so far is attached
You'll want to tie some code to that button (right-click on it). Not sure if this will help you, but here is an example:
Sub yadda()
With Sheets("Data Capture Form")
Worksheets(Format$(.Range("b2").Value, "mmmm") & " Monthly"). _
Range("a65536").End(xlUp)(2).Value = _
.Range("b4").Value
End With
End Sub
Didn't your prof. give you any examples? And are you going to sort your sheets into the correct monthly order? :confused:
Starsurfer 01-27-2005, 03:58 PM I got no help, I will try what you said out thanks.
Starsurfer 01-27-2005, 04:00 PM OK, Nate I tried it and Im afraid nothing has happened. I am uploading a new copy of the file for you to see.
NateO 01-27-2005, 04:01 PM You are welcome.
Yes, but you make it sound like you weren't taught what a Range Object is or how to refer to one, or what the End Method is, and that strikes me as fairly rudimentary for an Excel VBA course. So much so, I might ask for a refund... :confused:
Starsurfer 01-27-2005, 04:06 PM Nate, its not a VBA course as such, its a general computing course and this is wht they asked me to do.
NateO 01-27-2005, 04:07 PM Holy schneikies, don't put that code in a Worksheet Class Module... And, you see that long line of red code? That's a problem, you'll want to fix that.
Delete the code from that module.
Right-click on that button->Assign Macro...->New. This will create a new Normal module and tie that Form button you have to a procedure. Paste the procedure inside the code your staring at. And delete:
Sub yadda() and End Sub
Now hammer that button a few times and check out the April sheet.
NateO 01-27-2005, 04:08 PM Nate, its not a VBA course as such, its a general computing course and this is wht they asked me to do.
And they reasonably expect you to do this in a short time frame? Erm, that's venturing on insanity. :huh:
It's a language, you need to learn it at some point if you want to speak it (or have to as the case may be). You can't just sit down and start writing in a foreign language without studying it. :confused:
Starsurfer 01-27-2005, 04:12 PM Nate, what can I say? They expect basic macros, how basic macros will do this lord knows.
Anyway, will it work with a different month?
NateO 01-27-2005, 04:14 PM Macro's died with Excel '97. The nomenclature exists, but that's all it is. This is VBA based on Visual Basic. Your macro recorder can't give you conditionals as such...
Try it. But this is why I'm actually doing you a disservice; you have no clue what the (fairly basic) code I gave you means... If I were your prof and saw the code I just gave you, I'd ask you to explain it to me (I'm using shorthand for Item in there as well).
Start going through the help file, search on Format Function, End Method, Range Object.
Starsurfer 01-27-2005, 04:16 PM OK, I am going to start working on a basic project, but can I ask some quick bits of help first?
How do I get it to sort by months? and how do take multiple values over? and which part of your code is controlling which column the data goes to?
Thanks.
NateO 01-27-2005, 04:18 PM How do I get it to sort by months? and how do take multiple values over? and which part of your code is controlling which column the data goes to?
Range("a65536") refers to, erm, A65536, which is in column A.
Sort the sheets? Just drag them, yes-no?
Starsurfer 01-27-2005, 04:21 PM But what if I put 1/6/05 then it shouldnt go to april, how do you control that?
NateO 01-27-2005, 04:29 PM :huh: Did you try actually doing that? Where did the number go?
Seriously, if you're going to hand that in, you'd better have a handle on the Format Function for your sake. It would be kind of scary if neither you nor your prof. understand the code...
I don't mind helping you learn, and this is a solid approach, but it does little good for you nor I for me to get an A on your project.
Starsurfer 01-27-2005, 04:33 PM This is true, I have changed the value of a653.... to d because thats where it should be. However it gave me this subscript out of range. is the number different for that cell.
edit:Wrong again, I found the date had been changed meaning that the month was creating the error, not this change.
NateO 01-27-2005, 04:35 PM a653....
Your shorthand is meaningless to me, I don't know what that means or what you actually did. What did you actually pass? It's not a long procedure, repost with the VB tags.
A is the column
65536 is the row number.
You want 65536. It's the equivalent of hitting f5, goto a65536, hit your end key, hit the up arrow.
If you want to change the Column, change the letter.
Starsurfer 01-27-2005, 04:38 PM Nate it is the same as the one you gave me however, I have found the source of the error.
|