View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
derekc[_6_] derekc[_6_] is offline
external usenet poster
 
Posts: 1
Default insert amount into first emtpy cell

tried don's way and it gave me a zero for first row and that was it. an
0 wasnt right either and i dont have myVal. this is what i have s
far.

Private Sub launchbutton_1_Click()

lastRow = Worksheets("First Sheet").UsedRange.Row - 1
Worksheets("First Sheet").UsedRange.Rows.Count
lastCol = Worksheets("First Sheet").UsedRange.Column - 1
Worksheets("First Sheet").UsedRange.Columns.Count

With Worksheets("First Sheet")

For x = 2 To lastRow
On Error GoTo Skip
y = 7
runTot = 0
parts = .Cells(x, 7).Value
Do Until y = lastCol _
Or runTot parts
y = y + 1
runTot = runTot + .Cells(x, y).Value
Loop
If runTot parts Then
For z = 8 To y - 1
.Cells(x, z).Interior.ColorIndex = 6
Next z
ElseIf y = lastCol Then
For z = 8 To y
If .Cells(x, z).Value < "" Then
.Cells(x, z).Interior.ColorIndex = 6
End If
Next z
End If
Skip:
Next x

End With

End Su

--
Message posted from http://www.ExcelForum.com