View Single Post
  #15   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Doing MS Training in Excel, having Macro Issue

Why so loud Gord?

--
HTH

Bob

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

"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
Din MyCell as Range


Gord Dibben MS Excel MVP

On Wed, 16 Jul 2008 11:25:01 -0700, Judi<<

wrote:

Now I have this one. I defined z as long, but VBA is telling me that
MyCell
needs to be defined too, how do you define a cell?

Thanks again,
Judi <<


Option Explicit

Sub CountCells()

Dim z As Long

z = 0

For Each MyCell In Selection
z = z + 1
Next

MsgBox "There are " & z & " cells in the selection."

End Sub