View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bernard Liengme
 
Posts: n/a
Default 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