Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Select i Rows

I wish to select a line i with i defined as
For i = 2 To Last_Row(Sheets("Stocks").Columns("A:A")) + 1

I wrote

Rows("i:i").Select

but it is not working. I am dumb. I still dont understand this story
of brakets, could someone take two minutes to explain it to me or tell
me where should I look, please?
Kind regards
Daniel

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Select i Rows

rows(i).Select

--
Regards,
Tom Ogilvy


" wrote:

I wish to select a line i with i defined as
For i = 2 To Last_Row(Sheets("Stocks").Columns("A:A")) + 1

I wrote

Rows("i:i").Select

but it is not working. I am dumb. I still dont understand this story
of brakets, could someone take two minutes to explain it to me or tell
me where should I look, please?
Kind regards
Daniel


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Select i Rows

Thank you for the answer, Tom

On Feb 1, 3:18 pm, Tom Ogilvy
wrote:
rows(i).Select

--
Regards,
Tom Ogilvy

" wrote:
I wish to select a line i with i defined as
For i = 2 To Last_Row(Sheets("Stocks").Columns("A:A")) + 1


I wrote


Rows("i:i").Select


but it is not working. I am dumb. I still dont understand this story
of brakets, could someone take two minutes to explain it to me or tell
me where should I look, please?
Kind regards
Daniel



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Select i Rows

I'll try:

For i = 2 To LastRow

i will equal an integer, so the first occurence using Rows("i:i") would
translate to Rows("2:2") which is syntax not recognized by VBA. If you used
Rows(i) it would translate to Rows(2) and would be recognized as the correct
syntax.

For a more detailed explanation, open the VB editor (Alt+F11) and click on
help. Type "Referring to cells" in the search box and you will see three or
four references there that explain the different sytax used in refrerring to
cells and ranges of cells.

" wrote:

I wish to select a line i with i defined as
For i = 2 To Last_Row(Sheets("Stocks").Columns("A:A")) + 1

I wrote

Rows("i:i").Select

but it is not working. I am dumb. I still dont understand this story
of brakets, could someone take two minutes to explain it to me or tell
me where should I look, please?
Kind regards
Daniel


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
How can i randomly select 780 rows from 4000 rows of data bbb Excel Worksheet Functions 2 July 6th 07 08:21 PM
Trying to select rows Arne Hegefors Excel Programming 4 July 20th 06 05:22 PM
select rows [email protected] Excel Worksheet Functions 1 March 1st 06 03:57 AM
select block of rows w/data between blank rows Janna Excel Programming 6 February 13th 05 02:45 AM
Unable to select rows in the repeat rows on top option Noppie Excel Discussion (Misc queries) 2 December 28th 04 03:17 PM


All times are GMT +1. The time now is 08:42 AM.

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"