ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA NEWBIE Need A Bit of Help (https://www.excelbanter.com/excel-programming/416463-vba-newbie-need-bit-help.html)

Wile Coyote

VBA NEWBIE Need A Bit of Help
 
Am just starting to learn a bit about VBA & Hoping someone can offer some
help.

have a worksheet with a table say 5 columns wide by 10 rows, however could
at times have more rows

i want to insert an object in the first row UNDER the table's Last Row

i have been able to do that easily when the table is a fixed size and the
row number is always the same, but i can't figure out how to make my code
identify which is the last row of the table and go to the next row below
that

TIA for any help

WC

FSt1

VBA NEWBIE Need A Bit of Help
 
hi
number of ways to work this...
if you want to know the row number...
Dim r As Long
r = Cells(Rows.Count, "a").End(xlUp).Row
MsgBox r
Range("A" & r + 1).Select

or if the row number isn't important to what your are doing..
bottom up method....
range("A65536").end(xlup).offset(1,0).select

or if you have a solid block of data, go the other way....
top down method....
range("A1").end(xldown).offset(1,0).select

regards
FSt1




"Wile Coyote" wrote:

Am just starting to learn a bit about VBA & Hoping someone can offer some
help.

have a worksheet with a table say 5 columns wide by 10 rows, however could
at times have more rows

i want to insert an object in the first row UNDER the table's Last Row

i have been able to do that easily when the table is a fixed size and the
row number is always the same, but i can't figure out how to make my code
identify which is the last row of the table and go to the next row below
that

TIA for any help

WC


nowhereman

VBA NEWBIE Need A Bit of Help
 
?B?RlN0MQ==?= wrote in
:

Thank You ..... Works great!


hi
number of ways to work this...
if you want to know the row number...
Dim r As Long
r = Cells(Rows.Count, "a").End(xlUp).Row
MsgBox r
Range("A" & r + 1).Select

or if the row number isn't important to what your are doing..
bottom up method....
range("A65536").end(xlup).offset(1,0).select

or if you have a solid block of data, go the other way....
top down method....
range("A1").end(xldown).offset(1,0).select

regards
FSt1




"Wile Coyote" wrote:

Am just starting to learn a bit about VBA & Hoping someone can offer
some help.

have a worksheet with a table say 5 columns wide by 10 rows, however
could at times have more rows

i want to insert an object in the first row UNDER the table's Last
Row

i have been able to do that easily when the table is a fixed size
and the row number is always the same, but i can't figure out how to
make my code identify which is the last row of the table and go to
the next row below that

TIA for any help

WC




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

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