VBA NEWBIE Need A Bit of Help

  • Thread starter Thread starter Wile Coyote
  • Start date Start date
W

Wile Coyote

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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top