![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Apr 2002
Location: Detroit
Posts: 792
|
Trying to account for a field having a "0" or it was blanked out
Here is the code (there is some logic to determine start and end condition) --------------- Sub UpdateSheetTest() Dim i As Integer Dim bStart As Boolean Dim oneH As Long bStart = False For i = 1 To 100 If Cells(i, 2).Value = "Grand Total" Then Exit For ' define end of processing If bStart = True Then If Cells(i, 1).Value <> 0 Then ' insure there is a quantity defined in col A '-------------- next line should say "if column 8 has a numeric value > 0" (account for BLANK) If (Cells(i, Cells(i, 10).Value = Cells(i, 1).Value * Cells(i, 5).Value Cells(i, 11) = "Used-1" ElseIf (Cells(i, ' ------- This line gives an error --- trying to apply a percentage calculation ' Cells(i, 10).Value = Cells(i, 1).Value * (Cells(i, 5).Value - (Cells(i, 5).Value * Cells(i, Cells(i, 11) = "Used-2" Else Cells(i, 11) = "Used-None" ' unknown condition End If End If End If If Cells(i, 1).Value = "Qty." Then bStart = True ' define start Next End Sub --------------------------- |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Apr 2002
Location: Detroit
Posts: 792
|
The special character is the number 8
Do not know why the funkie display |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Apr 2002
Location: Greenwood, SC
Posts: 677
|
Just replied to your private message.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|