ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   About going through all the cells in a sheet.... (https://www.excelbanter.com/excel-programming/349603-about-going-through-all-cells-sheet.html)

marko

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




Bob Phillips[_6_]

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


"marko" wrote in message ...
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



Toppers

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





marko

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" wrote in message
...


"marko" wrote in message ...
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





Bob Phillips[_6_]

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" wrote in message ...
Thanks!!
And how can i go one cell to the right?
To B1.
Thanks!

Marko

"Bob Phillips" wrote in message
...


"marko" wrote in message ...
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







marko

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

"Bob Phillips" wrote in message
...
Activecell.Offset(0,1)

--

HTH

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


"marko" wrote in message ...
Thanks!!
And how can i go one cell to the right?
To B1.
Thanks!

Marko

"Bob Phillips" wrote in message
...


"marko" wrote in message
...
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









marko

About going through all the cells in a sheet....
 
It helped me a lot!!!
Thanks!
Marko


"Toppers" wrote in message
...
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








All times are GMT +1. The time now is 03:38 PM.

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