ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   About going through all the cells in a sheet.... (https://www.excelbanter.com/excel-discussion-misc-queries/63273-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





Bernard Liengme

About going through all the cells in a sheet....
 
To find the last cell in any row, use this macro
Sub findlast()
myrow = Application.InputBox("What row")
firstcell = "IV" & myrow
Set mc = Range(firstcell).End(xlToLeft)
MsgBox (mc.Address)
End Sub

If only row 1 is of interest
Sub findlast()
Set mc = Range("IV1").End(xlToLeft)
MsgBox (mc.Address)
End Sub


To select a certain cell (say A10)
Range("A10").Select
or
Cells(1,10).Select

best wishes
suggest you look for VBA tutorial and/or book
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"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)

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 for all your help!!!
Can you recomend some free online tutorial for VBA?
Best Regards,

Marko

"Bernard Liengme" wrote in message
...
To find the last cell in any row, use this macro
Sub findlast()
myrow = Application.InputBox("What row")
firstcell = "IV" & myrow
Set mc = Range(firstcell).End(xlToLeft)
MsgBox (mc.Address)
End Sub

If only row 1 is of interest
Sub findlast()
Set mc = Range("IV1").End(xlToLeft)
MsgBox (mc.Address)
End Sub


To select a certain cell (say A10)
Range("A10").Select
or
Cells(1,10).Select

best wishes
suggest you look for VBA tutorial and/or book
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"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)

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 06:26 AM.

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