PDA

View Full Version : [SOLVED] beginner here.



Hedgehog
11-26-2004, 02:20 PM
Could someone recommend a good book for beginners. I have programming experience with Qbasic, but nothing with VBA. I'm also an intermediate Excel user.

Also, what's the proper syntax for displaying text in a cell? This doesn't work:

range("a1").value = "printing"

thanks.:hi:

Jacob Hilderbrand
11-26-2004, 02:54 PM
We offer beginner VBA training here. Just click the training link on the left side vavigation bar.

range("a1").value = "printing"
This is correct.

Hedgehog
11-27-2004, 01:55 AM
Thanks DRJ.

When I enter that code by itself, it won't compile. I realized that I had to make it into a subroutine and click the run icon:


Sub t1()
Range("a1").Value = "printing"
End Sub

Why can't I just enter it as a statement?

I saw the training link and I might give it a try, but I'd still like to buy a book. Any sugestions?

Jacob Hilderbrand
11-27-2004, 02:08 AM
Code needs to be in a sub or function for VBA to compile and run it. There are certain statements that can go outside of a sub/function, but most of your code will not.

byundt
11-27-2004, 11:25 AM
You can enter statements in the Immediate pane and they will be executed as entered. To open the Immediate pane, CTRL + G (assuming you are already in the VBA Editor).

If you prefix the statement with a ?, then the value resulting from the statement will be displayed. This is often helpful when stepping through code with the F8 and F5 keys.

If you need two or more statements to be executed at once, then separate them with a colon--A=B : C=D