ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel and VB.NET Help!!! (https://www.excelbanter.com/excel-programming/366363-excel-vbulletin-net-help.html)

mivey

Excel and VB.NET Help!!!
 
Hello,

If I am in the wrong place, I apologize and please let me know.

I need a sample if anyone can provide it or a link for how I can
programmatically access row by row; 1 column of data in Excel.

I have created a program that exports data from a database into an Excel
spreadsheet and now I'd like to query a specified column in the sheet and
read the values contained in the underlying rows to see if a certain
condition is met.

Though guidance in VB.NET would be desirable, I will accept any VB or VBA
examples because I can convert the logic.

Any help would be appreciated!

Thanks,

mivey4



Nick Hodge

Excel and VB.NET Help!!!
 
Mivey

You would use a range object variable and iterate through the column to test
the value. In VBA this would be

Sub IterateColumn()
Dim myCell as Range
For Each myCell in Range("A1:A100")
'Do test here
Next MyCell
End Sub

Of course you could also assign the cells used to a variable and loop this
number of times using either cells or range objects

Range("A" & myVariable).Value
Cells(myVariable,1).Value

If you need more help getting it to VB.Net post back. I'm just starting out
with it, but we may be able to help


--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
HIS


"mivey" wrote in message
...
Hello,

If I am in the wrong place, I apologize and please let me know.

I need a sample if anyone can provide it or a link for how I can
programmatically access row by row; 1 column of data in Excel.

I have created a program that exports data from a database into an Excel
spreadsheet and now I'd like to query a specified column in the sheet and
read the values contained in the underlying rows to see if a certain
condition is met.

Though guidance in VB.NET would be desirable, I will accept any VB or VBA
examples because I can convert the logic.

Any help would be appreciated!

Thanks,

mivey4




chuby

Excel and VB.NET Help!!!
 
actually you should post that in other forums for programming vB or whatever
look into MsDN ( microsoft developers network ) and find the excel.worksheet
object there are the methods, properties and all you need to manage
worksheets from your application with good explanations for VB and c++ ( not
for delphi :S ) anyhow there is where you can find all the info.

also look at excel.workbook and excel.application for more complex stuff

ttfn

"mivey" wrote:

Hello,

If I am in the wrong place, I apologize and please let me know.

I need a sample if anyone can provide it or a link for how I can
programmatically access row by row; 1 column of data in Excel.

I have created a program that exports data from a database into an Excel
spreadsheet and now I'd like to query a specified column in the sheet and
read the values contained in the underlying rows to see if a certain
condition is met.

Though guidance in VB.NET would be desirable, I will accept any VB or VBA
examples because I can convert the logic.

Any help would be appreciated!

Thanks,

mivey4





All times are GMT +1. The time now is 07:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com