Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Excel VBA Sheet(variable).range... possible ?

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




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 695
Default Excel VBA Sheet(variable).range... possible ?

Sub tst()
Var = 3
Sheets("Sheet" & Var).Activate
Range("A1").Select
End Sub


"Phil" skrev:

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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I set up a variable reference range in Excel? Pecan1862 Excel Programming 1 January 27th 06 09:29 PM
Can I use a variable to call up another sheet in Excel? GD Cooley Excel Worksheet Functions 1 February 13th 05 05:40 AM
Can I use a variable to call up another sheet in Excel? GD Cooley Excel Worksheet Functions 0 February 11th 05 02:47 PM
setting a range variable equal to the value of a string variable Pilgrim Excel Programming 2 July 1st 04 11:32 PM
Problem trying to us a range variable as an array variable TBA[_2_] Excel Programming 4 September 27th 03 02:56 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"