Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Newbie: Dimming a variable.

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Newbie: Dimming a variable.

You should ALWAYS use Option Explicit. Dim your Cell variable As Range.


wrote in message
oups.com...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Newbie: Dimming a variable.


You should ALWAYS...


Yup, sorry you missed the sarcasm. Thanks for the ultra-quick
response.

Aunt Joy


Reply
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
dimming text shovelhead69 Excel Discussion (Misc queries) 1 June 13th 06 07:49 PM
Public variable defintion (newbie) gregga[_2_] Excel Programming 0 October 7th 04 02:22 PM
A Whole Lot a Dimming Going On Robert Lerner Excel Programming 6 September 14th 04 06:05 AM
Frame as variable (newbie question) Rik Smith Excel Programming 3 September 10th 04 03:22 AM
Dimming Controls David Benson[_2_] Excel Programming 1 October 10th 03 09:49 PM


All times are GMT +1. The time now is 06:57 PM.

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

About Us

"It's about Microsoft Excel"