+ Reply to Thread
Results 1 to 4 of 4

Determine Column

  1. #1
    csbennett
    Guest

    Determine Column

    I need to loop through all the rows in a spreadsheet and load the data into
    various
    columns in a table. How do I refer to each column in each row without hard
    coding the row number? For instance, in each row I loop through I want to
    save off column A into a variable. I need to know how to code that.

    Thanks.

  2. #2
    Tom Ogilvy
    Guest

    Re: Determine Column

    for i = 1 to 10
    var = cells(i,"A").Value
    Next

    --
    Regards,
    Tom Ogilvy

    "csbennett" <[email protected]> wrote in message
    news:[email protected]...
    > I need to loop through all the rows in a spreadsheet and load the data

    into
    > various
    > columns in a table. How do I refer to each column in each row without

    hard
    > coding the row number? For instance, in each row I loop through I want to
    > save off column A into a variable. I need to know how to code that.
    >
    > Thanks.




  3. #3
    Bob Phillips
    Guest

    Re: Determine Column


    iLastRow = Cells(Rows.Count,"A").End(xlUp),Row
    For i = 1 to iLastRow
    myVar = Cells(i,"A").Value
    Next i

    This is incomplete, as I assume you will do something with myVar, but
    hopefully it will get you started.

    --
    HTH

    Bob Phillips

    "csbennett" <[email protected]> wrote in message
    news:[email protected]...
    > I need to loop through all the rows in a spreadsheet and load the data

    into
    > various
    > columns in a table. How do I refer to each column in each row without

    hard
    > coding the row number? For instance, in each row I loop through I want to
    > save off column A into a variable. I need to know how to code that.
    >
    > Thanks.




  4. #4
    csbennett
    Guest

    Re: Determine Column

    Thank you. That helps!

    "Bob Phillips" wrote:

    >
    > iLastRow = Cells(Rows.Count,"A").End(xlUp),Row
    > For i = 1 to iLastRow
    > myVar = Cells(i,"A").Value
    > Next i
    >
    > This is incomplete, as I assume you will do something with myVar, but
    > hopefully it will get you started.
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > "csbennett" <[email protected]> wrote in message
    > news:[email protected]...
    > > I need to loop through all the rows in a spreadsheet and load the data

    > into
    > > various
    > > columns in a table. How do I refer to each column in each row without

    > hard
    > > coding the row number? For instance, in each row I loop through I want to
    > > save off column A into a variable. I need to know how to code that.
    > >
    > > Thanks.

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1