Hey guys. So I'm currently building an app and I'm having a bit of trouble. So I have an Excel file and it reads it and opens it fine(I imported microsoft.office.interops.excel but what I want to know is how to loop through column A and pick out the rows that are equal to "USA Hawaii". And then out of those rows I want it to pick out the rows in column B that say "7". And then out of those rows I want it to pick out the row that says "58". I was going to use and If statement but I'm just having trouble because I've never used an Excel file in VB before. My If statement would go something like this

If My.Settings.Location = #read through all the rows in column A that have USA Hawaii# and now.Hour = #read through all the rows in column B that have 7# and now.Minute = #read through all the rows in column C that have 58# then
'do some stuff
end if

Can somebody help me? Thanks.

Recommended Answers

All 2 Replies

Just read through column A: if ="USA Hawaii" check column B and column C.
IF OK do something, else continue reading column A.

How do you read through columns in code though? That's the part I don't know

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.