Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Refer to a different worksheet


Hi there,

I have this code

With ActiveSheet.QueryTables.Add(Connection:= _
"OLEDB;Provider=Microsoft.Office.List.OLEDB.1. 0;",
Destination:=Range("A1"))

What I need is a code that doens not refer to the active sheet but to a
sheet with name TimeToImplement cell A1. How do I go about?!

Regards,

Basta1980
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Refer to a different worksheet


if you mean the worksheet name is in A1 of the activesheet, then

With WorkSheets( Range("A1").Value ).QueryTables.Add(Connection:= _
"OLEDB;Provider=Microsoft.Office.List.OLEDB.1. 0;", _
Destination:= .Range("A1"))


"Basta1980" wrote in message
...
Hi there,

I have this code

With WorkSheets(Range("A1"),Value).QueryTables.Add(Conn ection:= _
"OLEDB;Provider=Microsoft.Office.List.OLEDB.1. 0;",
Destination:=Range("A1"))

What I need is a code that doens not refer to the active sheet but to a
sheet with name TimeToImplement cell A1. How do I go about?!

Regards,

Basta1980


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Refer to a different worksheet


With ActiveWorkbook.Sheets("TimeToImplement").QueryTabl es.Add(Connection:= _
"OLEDB;Provider=Microsoft.Office.List.OLEDB.1. 0;",
Destination:=Range("A1"))

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


"Basta1980" wrote:

Hi there,

I have this code

With ActiveSheet.QueryTables.Add(Connection:= _
"OLEDB;Provider=Microsoft.Office.List.OLEDB.1. 0;",
Destination:=Range("A1"))

What I need is a code that doens not refer to the active sheet but to a
sheet with name TimeToImplement cell A1. How do I go about?!

Regards,

Basta1980

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Refer to a different worksheet


Patrick,

Thanks, but the problem was I didn't want to refer to an activesheet. But
this got me going in the right direction.

Thnx

Basta1980

"Patrick Molloy" wrote:

if you mean the worksheet name is in A1 of the activesheet, then

With WorkSheets( Range("A1").Value ).QueryTables.Add(Connection:= _
"OLEDB;Provider=Microsoft.Office.List.OLEDB.1. 0;", _
Destination:= .Range("A1"))


"Basta1980" wrote in message
...
Hi there,

I have this code

With WorkSheets(Range("A1"),Value).QueryTables.Add(Conn ection:= _
"OLEDB;Provider=Microsoft.Office.List.OLEDB.1. 0;",
Destination:=Range("A1"))

What I need is a code that doens not refer to the active sheet but to a
sheet with name TimeToImplement cell A1. How do I go about?!

Regards,

Basta1980



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Refer to a different worksheet


Jakob,

Thanks. With a slight change (destination required sheetname) the code
worked perfect.

Regards

basta1980

"Jacob Skaria" wrote:

With ActiveWorkbook.Sheets("TimeToImplement").QueryTabl es.Add(Connection:= _
"OLEDB;Provider=Microsoft.Office.List.OLEDB.1. 0;",
Destination:=Range("A1"))

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


"Basta1980" wrote:

Hi there,

I have this code

With ActiveSheet.QueryTables.Add(Connection:= _
"OLEDB;Provider=Microsoft.Office.List.OLEDB.1. 0;",
Destination:=Range("A1"))

What I need is a code that doens not refer to the active sheet but to a
sheet with name TimeToImplement cell A1. How do I go about?!

Regards,

Basta1980

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 to get evaluated value of worksheet names that do not refer to worksheet ranges? Dick Watson Excel Programming 1 December 14th 08 03:56 AM
How to refer to an other worksheet (or book) noyau Excel Programming 1 December 27th 06 07:36 AM
Refer to worksheet Arne Hegefors Excel Programming 2 August 25th 06 01:39 PM
Refer to a worksheet from a userform leonidas[_49_] Excel Programming 1 July 24th 06 12:42 PM
refer to specific worksheet Dirk Nachbar Excel Programming 2 July 21st 06 09:47 AM


All times are GMT +1. The time now is 04:17 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"