Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Get data from closed file

Hi, as of now I am using formulas to get data from closed files. I was
looking if I can get data from a closed file with that help of macro?

Source file R3:R15
Destination file C3:O3 (Transpose)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Get data from closed file

hi
see this site
http://www.rondebruin.nl/ado.htm

regards
FSt1

"Kashyap" wrote:

Hi, as of now I am using formulas to get data from closed files. I was
looking if I can get data from a closed file with that help of macro?

Source file R3:R15
Destination file C3:O3 (Transpose)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Get data from closed file

but nothing is mentioned regarding Transpose there..
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Get data from closed file

hi
after bringing in the data with ADO, you could then transpose it by adding a
line of code at the end.

Range("C3").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True

regards
FSt1

"Kashyap" wrote:

but nothing is mentioned regarding Transpose there..

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Get data from closed file

But can't we get it transposed while getting the same?


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default Get data from closed file

Get what data from what file, and how ?

If you mean from a closed Excel file (though you don't say...) it would help
to specify the method you're currently using.

Tim

"Kashyap" wrote in message
...
But can't we get it transposed while getting the same?



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Get data from closed file

I use this line of code to access other Excel Workbooks. You can acutally
use similar code to access any file type:

Workbooks.Open fileName:="C:\yourFileName.xls"

Once it's opened, it will be activated and you can manipulate it anyway you
want to other lines of VBA code.

GP Michal

"FSt1" wrote:

hi
see this site
http://www.rondebruin.nl/ado.htm

regards
FSt1

"Kashyap" wrote:

Hi, as of now I am using formulas to get data from closed files. I was
looking if I can get data from a closed file with that help of macro?

Source file R3:R15
Destination file C3:O3 (Transpose)

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Get data from closed file

I have the below code.. But the range is fixed in the below case.. How to
make it dynamic?

i.e: if value in peter.xls Sheets("may") A2:AD2 matches value in current
sheet A2 then

it should copy values from row3 to row 21 from peter.xls Sheets("may") to
current sheet D1

Sub GetData_Example3()
GetData "D:\SavedFiles\CK\ZSL\May\\peter.xls", "May", _
"E3:E21", Sheets("may").Range("D1"), False, False

End Sub

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
Write data in a closed file? Nicolas[_3_] Excel Programming 1 February 2nd 07 02:47 AM
Write data in a closed file? Nicolas[_3_] Excel Programming 1 February 1st 07 01:26 AM
CAN I IMPORT DATA FROM A CLOSED FILE TO A NEW WORKSHEET Paul Excel Discussion (Misc queries) 1 January 11th 07 02:30 PM
Extract Certain Data from closed file joecrabtree Excel Programming 2 November 30th 06 04:22 PM
How do I copy data from a closed file. Rob Moore Excel Programming 4 August 26th 06 01:20 PM


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