Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default For Each cell - Variable not defined (VBA)

Hi,

I wrote code that inclue :
For Each cell In myRng
....
next
I got error "Variable not defined" and I don't find the reason.
(I some cases it's work but I didn't seccess to recognize when).

Please help, thanks
Shlomit
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 266
Default For Each cell - Variable not defined (VBA)

"Shlomit" skrev i en meddelelse
...
Hi,

I wrote code that inclue :
For Each cell In myRng
...
next
I got error "Variable not defined" and I don't find the reason.
(I some cases it's work but I didn't seccess to recognize when).

Please help, thanks
Shlomit


Hi Shlomit

Try this:

Dim cell As Variant

For Each cell In myRng.Cells


--
Best regards
Leo Heuser

Followup to newsgroup only please.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default For Each cell - Variable not defined (VBA)

Try declaring this before the code:

Dim cell as range
or
Dim myRng as range

On Jan 25, 2:54 am, Shlomit wrote:
Hi,

I wrote code that inclue :
For Each cell In myRng
...
next
I got error "Variable not defined" and I don't find the reason.
(I some cases it's work but I didn't seccess to recognize when).

Please help, thanks
Shlomit


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
looping through variable defined cell [email protected] Excel Programming 0 September 8th 06 04:31 AM
msoShapeRectangle -- Variable not defined ??? Linda Edlund Excel Programming 3 May 4th 06 10:06 AM
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? Daniel Excel Worksheet Functions 1 July 9th 05 03:05 AM
[Q] msoShapeRectangle: variable not defined Rolf Marvin Bøe Lindgren Excel Programming 4 May 12th 04 10:21 AM
Variable Not Defined? objPivotCache BEE Excel Programming 1 December 15th 03 05:02 PM


All times are GMT +1. The time now is 07:27 AM.

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"