Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can i randomly select 780 rows from 4000 rows of data | Excel Worksheet Functions | |||
Trying to select rows | Excel Programming | |||
select rows | Excel Worksheet Functions | |||
select block of rows w/data between blank rows | Excel Programming | |||
Unable to select rows in the repeat rows on top option | Excel Discussion (Misc queries) |