ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get data from closed file... Cont.. (https://www.excelbanter.com/excel-programming/428882-get-data-closed-file-cont.html)

Kashyap

Get data from closed file... Cont..
 
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

Ron de Bruin

Get data from closed file... Cont..
 
Hi Kashyap

Use other code then to have full control
Try this
http://www.rondebruin.nl/copy3.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Kashyap" wrote in message ...
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



All times are GMT +1. The time now is 01:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com