go to cell

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Cells(Columns.Count, 2).Select
Cells(Rows.Count, 2).Select
shouldnt that go to B2? it goes to B65536

basically what i want is i have a value in "J1" (example 23) and i want is
Cells(Columns.Count, 2).Select
Cells(Rows.Count, Range("tracking!J1".Value).Select

and that would go to B23

thanks in advance
 
the syntax for cells() is:

cells(#rows,#columns)

so cells(rows.count,2).select
is the same as cells(65536,2).select
which is column B, row 65536

cells(2,2).select
would go to B2
a less ambiguous example:
cells(3,2).select
would go to B3.

so...

cells(range("tracking!j1").value,2).select
would work.

I find this syntax easier to understand:

cells(worksheets("tracking").range("J1").value,2).select
 

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