View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default VBA Tutorial problem

Sounds like you have Option Explicit in your modules, which is a good
practice, so try

Sub HelloWorld()
Dim CurrentSheet As Worksheet

Set CurrentSheet = Application.ActiveSheet

CurrentSheet.Cells(2, 5) = "Hello World!"

End Sub



--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"AFJr" wrote in message
...
Hi,

I'm taking this tutorial

http://homepages.ius.edu/WCLANG/vbnotes/vbex2.htm

and cannot run the macro for the "Hello World!" procedure. I get a compile
error with when i try to run this:
- the yellow cursor pointing at the defined "Sub Hello World()"
- "CurrentSheet =" is selected

Here is the code from my sheet1 object:

Sub HelloWorld()

Set CurrentSheet = Application.ActiveSheet

CurrentSheet.Cells(2, 5) = "Hello World!"

End Sub

Any help would be appreciated. I am running Excel97 (I know, I know, its
old)

--
TIA

AFJr