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: 1
Default Evaluate Range of Cell


Hi:

I have an extremely large wb with hundreds of ws. All ws' have the
same format.
I need to evaluate all cells in range F25:R29 and if the value of the
cell has a number 0 then go to the next. If the value is blank then
insert a zero. I have been using the code below but for for some
reason, after 20 ws' or so, it starts writting zeros in other cells.

Any help is welcome.

Sub makeZero()
For Each SH In ActiveWorkbook.Worksheets
SH.Activate

Range("F21").Activate
For i = 1 To 13
If ActiveCell = "" Then
ActiveCell = 0
ActiveCell.Offset(0, 1).Select
ElseIf ActiveCell = "N/A" Then
ActiveCell = 0
ActiveCell.Offset(0, 1).Select
ElseIf ActiveCell < 0 Then
ActiveCell.Offset(0, 1).Select
ElseIf ActiveCell = 0 Then
ActiveCell.Offset(0, 1).Select
End If
Next i

'''''''''''''''''''''

Range("F25").Activate

For i = 1 To 13
If ActiveCell = "" Then
ActiveCell = 0
ActiveCell.Offset(1, 0).Select
ElseIf ActiveCell = "N/A" Then
ActiveCell = 0
ActiveCell.Offset(0, 1).Select
ElseIf ActiveCell < 0 Then
ActiveCell.Offset(1, 0).Select
ElseIf ActiveCell = 0 Then
ActiveCell.Offset(1, 0).Select
End If
If ActiveCell = "" Then
ActiveCell = 0
ActiveCell.Offset(1, 0).Select
ElseIf ActiveCell = "N/A" Then
ActiveCell = 0
ActiveCell.Offset(0, 1).Select
ElseIf ActiveCell < 0 Then
ActiveCell.Offset(1, 0).Select
ElseIf ActiveCell = 0 Then
ActiveCell.Offset(1, 0).Select
End If
If ActiveCell = "N/A" Then
ActiveCell = 0
ActiveCell.Offset(1, 0).Select
ElseIf ActiveCell = "" Then
ActiveCell = 0
ActiveCell.Offset(0, 1).Select
ElseIf ActiveCell < 0 Then
ActiveCell.Offset(1, 0).Select
ElseIf ActiveCell = 0 Then
ActiveCell.Offset(1, 0).Select
End If
If ActiveCell = "" Then
ActiveCell = 0
ActiveCell.Offset(1, 0).Select
ElseIf ActiveCell = "N/A" Then
ActiveCell = 0
ActiveCell.Offset(0, 1).Select
ElseIf ActiveCell < 0 Then
ActiveCell.Offset(1, 0).Select
ElseIf ActiveCell = 0 Then
ActiveCell.Offset(1, 0).Select
End If

If ActiveCell = "" Then
ActiveCell = 0
ActiveCell.Offset(-4, 1).Select
ElseIf ActiveCell = "N/A" Then
ActiveCell = 0
ActiveCell.Offset(0, 1).Select
ElseIf ActiveCell < 0 Then
ActiveCell.Offset(-4, 1).Select
ElseIf ActiveCell = 0 Then
ActiveCell.Offset(-4, 1).Select
End If

Next i

Next

End Sub




--
halem2
------------------------------------------------------------------------
halem2's Profile: http://www.excelforum.com/member.php...fo&userid=9930
View this thread: http://www.excelforum.com/showthread...hreadid=557861

 
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
HOWTO: What is the formula to have evaluate a range of value apache007 Excel Discussion (Misc queries) 9 February 6th 10 06:17 PM
Formula to Evaluate Range and Sum Different Column Dave Excel Discussion (Misc queries) 2 March 15th 09 09:49 PM
How to write vba to evaluate the text font and size on an active cell range? Paul Excel Programming 2 February 20th 06 08:48 PM
want sumif function's range to evaluate 2 columns Debgala Excel Worksheet Functions 7 November 6th 05 03:46 AM
HOW to Evaluate a range with IF ? dancab Excel Discussion (Misc queries) 3 September 1st 05 05:08 PM


All times are GMT +1. The time now is 11:50 AM.

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"