LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default For...Each loop not working

I'm trying to fill in a formula for each empty cell in Last_Cell (a range
that i declared); if the cell is not empty, it can skip that cell. Why
doesn't this work when there are definitely empty cells in the range?

Dim First_Cell, Last_Cell as Range
For Each First_Cell In Last_Cell
If Last_Cell Is Nothing Then
First_Cell.Activate
ActiveCell.Formula = "=dsum(H15:M2000,m15,ak5:al6)"
Else
Exit For
End If
Next First_Cell

End Sub
 
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
Loop Not Working Paul Black Excel Programming 7 August 29th 07 08:33 PM
Loop not working!! Simon Excel Programming 2 August 2nd 05 04:16 PM
Do...Loop not working Sunny Lin Excel Programming 1 April 14th 05 01:19 AM
for next loop not working Tom Ogilvy Excel Programming 0 September 27th 04 05:36 PM
for next loop not working Ron Rosenfeld Excel Programming 0 September 25th 04 04:07 AM


All times are GMT +1. The time now is 08:14 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"