LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 54
Default Doing MS Training in Excel, having Macro Issue

I am trying to work through the online training provided by Microsoft about
Excel 2003 and I have run into an issue with the Macro lesson.

Following the instructions exactly, I have entered this macro in to a module
in the spreadsheet:

Sub CountRows()

x = ActiveCell.Row
y = ActiveCell.Column
z = 0

Do While Cells(x, y).Value < ""
x = x + 1
z = z + 1
Loop

MsgBox "There are " & z & " rows in the current range."

End Sub

When I try to run the macro, it tell me that variable x is undefined. I
tried going into the spreadsheet and placing the focus where they said and
running it from there, but I get the same message.

Please help me understand what I need to do to fix this. I am doing the
training so that I can understand this, but if the training is wrong, how am
I supposed to learn?

Feel free to talk to me like a child, I'm completely new to VBA.

Thank you to all who offer help.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Macro- sort issue in Excel2003 Radhakrishna k.v.n.r[_2_] Excel Worksheet Functions 1 October 26th 07 10:02 AM
Macro training Steven Excel Discussion (Misc queries) 4 October 9th 07 12:55 AM
Excel 2007 Macro/Link Issue (apologies for cross-posting) MorgSz Links and Linking in Excel 2 July 25th 07 08:12 PM
Excel training abfabrob Excel Discussion (Misc queries) 1 May 21st 05 08:21 AM
Training in Excel Effie Excel Discussion (Misc queries) 1 May 13th 05 08:24 PM


All times are GMT +1. The time now is 04:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"