Excel VBA Sheet(variable).range... possible ?

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

Guest

Hi Everyone,

is it possible to add a variable to the sheet(var).range("A1").select
expression? I know of the sheets("name") expression, but this is a workbook
that contains multiple sheets, no naming convention, and requires me to go
back, forth and skip some sheets depending on user input.

Example:

Var = 10
sheet(Var).range("A1").select

would give:
sheet10.range("A1").select
 
Sub tst()
Var = 3
Sheets("Sheet" & Var).Activate
Range("A1").Select
End Sub


"Phil" skrev:
 

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