I am new to this programming stuff please help. I need to collect
information determined by what is in (Row,3) from (Row, 4) in excel.
Example would be in (Row,3) is West Region, and in (Row,4) is 1957.23
and it loops and increments by 1 row every time it loops to work down
the whole spreadsheet this way. I am not sure how to collect the data
and return a total for the East Region and West Region.  Here is a
sample of my code.


Dim row As Integer
Dim GrossProfitW() As Double
Dim GrossProfitE() As Double

row = 2

 Do While Sheets("Data").Cells(row, 4).Value <> ""

    If Sheets("Data").Cells(row, 3) = "West Region" Then
     GrossProfitW = Sheets("Data").Cells(row, 4)
    Else
     GrossProfitE = Sheets("Data").Cells(row, 4)
    End If

   row = row + 1
 Loop

  Sheets("Regional Report").Cells(7, 2) = GrossProfitW
  Sheets("Regional Report").Cells(6, 2) = GrossProfitE

-- 
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net

Reply via email to