Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Nev Nev is offline
external usenet poster
 
Posts: 20
Default variable in application line

I use the line below in part of my spreadsheets.

Application.Goto Reference:=Range("'addresses'" & "!a1")

Range("B7").Select

I would like to use this elsewhere where 'addresses' is a variable

ie It would pick up whatever is in sheet "info" F30 and take me to the
relevant sheet

How can I do this?

thanks

Nev
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default variable in application line

Dim rngTemp As Range
Set rngTemp = Sheets("Sheet2").Range("A1")
Application.Goto Reference:=rngTemp

If this post helps click Yes
---------------
Jacob Skaria


"Nev" wrote:

I use the line below in part of my spreadsheets.

Application.Goto Reference:=Range("'addresses'" & "!a1")

Range("B7").Select

I would like to use this elsewhere where 'addresses' is a variable

ie It would pick up whatever is in sheet "info" F30 and take me to the
relevant sheet

How can I do this?

thanks

Nev

  #3   Report Post  
Posted to microsoft.public.excel.programming
Nev Nev is offline
external usenet poster
 
Posts: 20
Default variable in application line

Jacob

Thanks for the quick reply. Sorry - I want to use whatever is in "Info F30"
as the variable. Therefore if "Info F30" said May it would take me to
worksheet "May", Sept to worksheet "September" etc

Thanks

nev


"Jacob Skaria" wrote:

Dim rngTemp As Range
Set rngTemp = Sheets("Sheet2").Range("A1")
Application.Goto Reference:=rngTemp

If this post helps click Yes
---------------
Jacob Skaria


"Nev" wrote:

I use the line below in part of my spreadsheets.

Application.Goto Reference:=Range("'addresses'" & "!a1")

Range("B7").Select

I would like to use this elsewhere where 'addresses' is a variable

ie It would pick up whatever is in sheet "info" F30 and take me to the
relevant sheet

How can I do this?

thanks

Nev

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default variable in application line

Dim strSheet as String
strSheet = Sheets("info").Range("F30")
Sheets(strSheet).Activate

OR

Dim strSheet as String
strSheet = Sheets("info").Range("F30")
Application.Goto Reference:=Sheets(strSheet).Range("A1")

--
If this post helps click Yes
---------------
Jacob Skaria


"Nev" wrote:

Jacob

Thanks for the quick reply. Sorry - I want to use whatever is in "Info F30"
as the variable. Therefore if "Info F30" said May it would take me to
worksheet "May", Sept to worksheet "September" etc

Thanks

nev


"Jacob Skaria" wrote:

Dim rngTemp As Range
Set rngTemp = Sheets("Sheet2").Range("A1")
Application.Goto Reference:=rngTemp

If this post helps click Yes
---------------
Jacob Skaria


"Nev" wrote:

I use the line below in part of my spreadsheets.

Application.Goto Reference:=Range("'addresses'" & "!a1")

Range("B7").Select

I would like to use this elsewhere where 'addresses' is a variable

ie It would pick up whatever is in sheet "info" F30 and take me to the
relevant sheet

How can I do this?

thanks

Nev

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
VBA code to run & wait for cmd line interface application David Excel Programming 1 April 18th 08 03:21 PM
Application.Run with variable number of arguments Doug Glancy[_8_] Excel Programming 3 July 6th 07 03:13 PM
Excel Application Level Global Variable wesbird Excel Programming 1 June 21st 05 12:52 AM
How to Reference Global Variable for external application. ajcross123 Excel Programming 4 July 29th 04 11:18 PM
application.Value(Variable) David Excel Programming 5 June 18th 04 11:54 PM


All times are GMT +1. The time now is 02:33 AM.

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"