Newbie: Dimming a variable.

A

auntjoy

Got my hands on a function, and I'm having a bit of difficulty with
it.

Public Function Sum_Visible_Cells(Cells_To_Sum As Object)
Application.Volatile
For Each Cell In Cells_To_Sum
If Cell.Rows.Hidden = False Then
If Cell.Columns.Hidden = False Then
Total = Total + Cell.Value
End If
End If
Next
Sum_Visible_Cells = Total
End Function

Compiler errors on "For Each Cell In", "Cell" comes up as an undefined
variable. So, I took out the "Option Explicit" at the top of the
module. FIXED THAT!!!! hahahahah.

Anyway, my question is: What should "Cell" be dimmed as?

Thanks so much for your help!

Aunt Joy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top