Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel: match two cells in one sheet to two cells in another and return a third cells value Spence Excel Worksheet Functions 3 February 13th 11 05:33 AM
How do I link cells, sheet to sheet, to recognize row deletions? LeeC Excel Discussion (Misc queries) 30 November 6th 09 10:26 PM
Copy Sheet to new Sheet and clear cells on original sheets Boiler-Todd Excel Discussion (Misc queries) 7 September 23rd 09 10:02 PM
Copying cells from on sheet to another sheet (via sheet module) CRayF Excel Programming 6 September 20th 05 08:58 PM
Copy row sheet-sheet skipping unqualified cells StevenL Excel Worksheet Functions 0 April 16th 05 11:11 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"