View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom London[_2_] Tom London[_2_] is offline
external usenet poster
 
Posts: 3
Default How do I work on data starting to a cell a cell with a require

Gary

Thanks that works. I'm going to play around with some of the keywords you
used and figure out how.

I want to sum all rows and display the reslt in the first column. Ant
pointers? I suspect this is fairly easy.

Tom

"Gary''s Student" wrote:

Try this small macro:

Sub sum_to_a_zero()
Dim v
Dim i As Long
i = InputBox("enter row number: ")
For j = 1 To 256
v = v + Cells(i, j).Value
If Cells(i, j).Value = 0 Then
Exit For
End If
Next
MsgBox (v)
End Sub
--
Gary's Student


"Tom London" wrote:

I have a workbook full of data. I want to sum the data to the left of cells
containing 0. The 0 occurs randomly. Any solutions appreciated but am
learning VBA at the moment and would particularly appreciate a VBA solution.

Thanks