+ Reply to Thread
Results 1 to 7 of 7

About going through all the cells in a sheet....

  1. #1
    marko
    Guest

    About going through all the cells in a sheet....

    Hi!
    I'm a newbie in excel but I'm learning and i would apriciate if someone
    would help me.
    I know something from the VB code because i work a little bit in VB .NET so
    i just need some instructions for the VB references (my english is bad, so i
    don't know which word to use) for excel.

    First:
    In the first row I would like to determine which cell is the last with any
    data(but only the first row, row 1).
    And in the first column I would like to determine which row is the last
    with any data(but only the first column, column A)

    Second:
    How do i position myself in a cell? Let's say cell K15.

    Thanks to everyone who is willing to help!

    Marko Svaco




  2. #2
    Bob Phillips
    Guest

    Re: About going through all the cells in a sheet....



    "marko" <[email protected]> wrote in message news:[email protected]...
    > Hi!
    > I'm a newbie in excel but I'm learning and i would apriciate if someone
    > would help me.
    > I know something from the VB code because i work a little bit in VB .NET

    so
    > i just need some instructions for the VB references (my english is bad, so

    i
    > don't know which word to use) for excel.
    >
    > First:
    > In the first row I would like to determine which cell is the last with any
    > data(but only the first row, row 1).
    > And in the first column I would like to determine which row is the last
    > with any data(but only the first column, column A)


    LastCell = Range("A1").End(xlRight)

    > Second:
    > How do i position myself in a cell? Let's say cell K15.


    Range("A1").Select



  3. #3
    Toppers
    Guest

    RE: About going through all the cells in a sheet....

    Marko
    Hope this helps:

    Sub a()
    Dim Lastcol As Integer, Lastrow As Long
    ' Last non-blank column in row 1
    ' If columns A,B have data, C is blank, D has data then Lastcol=4 i.e.
    Column D
    Lastcol = Cells(1, Columns.Count).End(xlToLeft).Column
    'last row in column 1 .. last non-blank column starting from bottom of column
    Lastrow = Cells(Rows.Count, 1).End(xlUp).Row
    ' data in K15
    Range("k15") = 1234
    ' cells(row,column)
    Cells(15, "K") = 1234
    Cells(15, 11) = 1234
    End Sub

    "marko" wrote:

    > Hi!
    > I'm a newbie in excel but I'm learning and i would apriciate if someone
    > would help me.
    > I know something from the VB code because i work a little bit in VB .NET so
    > i just need some instructions for the VB references (my english is bad, so i
    > don't know which word to use) for excel.
    >
    > First:
    > In the first row I would like to determine which cell is the last with any
    > data(but only the first row, row 1).
    > And in the first column I would like to determine which row is the last
    > with any data(but only the first column, column A)
    >
    > Second:
    > How do i position myself in a cell? Let's say cell K15.
    >
    > Thanks to everyone who is willing to help!
    >
    > Marko Svaco
    >
    >
    >
    >


  4. #4
    marko
    Guest

    Re: About going through all the cells in a sheet....

    Thanks!!
    And how can i go one cell to the right?
    To B1.
    Thanks!

    Marko

    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    >
    >
    > "marko" <[email protected]> wrote in message news:[email protected]...
    >> Hi!
    >> I'm a newbie in excel but I'm learning and i would apriciate if someone
    >> would help me.
    >> I know something from the VB code because i work a little bit in VB .NET

    > so
    >> i just need some instructions for the VB references (my english is bad,
    >> so

    > i
    >> don't know which word to use) for excel.
    >>
    >> First:
    >> In the first row I would like to determine which cell is the last with
    >> any
    >> data(but only the first row, row 1).
    >> And in the first column I would like to determine which row is the last
    >> with any data(but only the first column, column A)

    >
    > LastCell = Range("A1").End(xlRight)
    >
    >> Second:
    >> How do i position myself in a cell? Let's say cell K15.

    >
    > Range("A1").Select
    >
    >




  5. #5
    Bob Phillips
    Guest

    Re: About going through all the cells in a sheet....

    Activecell.Offset(0,1)

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "marko" <[email protected]> wrote in message news:[email protected]...
    > Thanks!!
    > And how can i go one cell to the right?
    > To B1.
    > Thanks!
    >
    > Marko
    >
    > "Bob Phillips" <[email protected]> wrote in message
    > news:%[email protected]...
    > >
    > >
    > > "marko" <[email protected]> wrote in message news:[email protected]...
    > >> Hi!
    > >> I'm a newbie in excel but I'm learning and i would apriciate if someone
    > >> would help me.
    > >> I know something from the VB code because i work a little bit in VB

    ..NET
    > > so
    > >> i just need some instructions for the VB references (my english is bad,
    > >> so

    > > i
    > >> don't know which word to use) for excel.
    > >>
    > >> First:
    > >> In the first row I would like to determine which cell is the last with
    > >> any
    > >> data(but only the first row, row 1).
    > >> And in the first column I would like to determine which row is the

    last
    > >> with any data(but only the first column, column A)

    > >
    > > LastCell = Range("A1").End(xlRight)
    > >
    > >> Second:
    > >> How do i position myself in a cell? Let's say cell K15.

    > >
    > > Range("A1").Select
    > >
    > >

    >
    >




  6. #6
    marko
    Guest

    Re: About going through all the cells in a sheet....

    THANKS!!!!!

    "Bob Phillips" <[email protected]> wrote in message
    news:[email protected]...
    > Activecell.Offset(0,1)
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "marko" <[email protected]> wrote in message news:[email protected]...
    >> Thanks!!
    >> And how can i go one cell to the right?
    >> To B1.
    >> Thanks!
    >>
    >> Marko
    >>
    >> "Bob Phillips" <[email protected]> wrote in message
    >> news:%[email protected]...
    >> >
    >> >
    >> > "marko" <[email protected]> wrote in message
    >> > news:[email protected]...
    >> >> Hi!
    >> >> I'm a newbie in excel but I'm learning and i would apriciate if
    >> >> someone
    >> >> would help me.
    >> >> I know something from the VB code because i work a little bit in VB

    > .NET
    >> > so
    >> >> i just need some instructions for the VB references (my english is
    >> >> bad,
    >> >> so
    >> > i
    >> >> don't know which word to use) for excel.
    >> >>
    >> >> First:
    >> >> In the first row I would like to determine which cell is the last with
    >> >> any
    >> >> data(but only the first row, row 1).
    >> >> And in the first column I would like to determine which row is the

    > last
    >> >> with any data(but only the first column, column A)
    >> >
    >> > LastCell = Range("A1").End(xlRight)
    >> >
    >> >> Second:
    >> >> How do i position myself in a cell? Let's say cell K15.
    >> >
    >> > Range("A1").Select
    >> >
    >> >

    >>
    >>

    >
    >




  7. #7
    marko
    Guest

    Re: About going through all the cells in a sheet....

    It helped me a lot!!!
    Thanks!
    Marko


    "Toppers" <[email protected]> wrote in message
    news:[email protected]...
    > Marko
    > Hope this helps:
    >
    > Sub a()
    > Dim Lastcol As Integer, Lastrow As Long
    > ' Last non-blank column in row 1
    > ' If columns A,B have data, C is blank, D has data then Lastcol=4 i.e.
    > Column D
    > Lastcol = Cells(1, Columns.Count).End(xlToLeft).Column
    > 'last row in column 1 .. last non-blank column starting from bottom of
    > column
    > Lastrow = Cells(Rows.Count, 1).End(xlUp).Row
    > ' data in K15
    > Range("k15") = 1234
    > ' cells(row,column)
    > Cells(15, "K") = 1234
    > Cells(15, 11) = 1234
    > End Sub
    >
    > "marko" wrote:
    >
    >> Hi!
    >> I'm a newbie in excel but I'm learning and i would apriciate if someone
    >> would help me.
    >> I know something from the VB code because i work a little bit in VB .NET
    >> so
    >> i just need some instructions for the VB references (my english is bad,
    >> so i
    >> don't know which word to use) for excel.
    >>
    >> First:
    >> In the first row I would like to determine which cell is the last with
    >> any
    >> data(but only the first row, row 1).
    >> And in the first column I would like to determine which row is the last
    >> with any data(but only the first column, column A)
    >>
    >> Second:
    >> How do i position myself in a cell? Let's say cell K15.
    >>
    >> Thanks to everyone who is willing to help!
    >>
    >> Marko Svaco
    >>
    >>
    >>
    >>




+ 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