ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying the data from the other worksheet (https://www.excelbanter.com/excel-programming/350206-copying-data-other-worksheet.html)

Sylvia[_14_]

Copying the data from the other worksheet
 

Hi..

I have to write one macro which will add a button allowing Copy
function. This button should allow us to copy the whole contents of
some another Excel file (containing single tab) into the currently open
file.

For this I also need to add a search box which will allow me to search
and select the file in windows after clicking on the above button and
then proceed further..

Can anyone help me for this please?

Thanks,
Sylvia


--
Sylvia
------------------------------------------------------------------------
Sylvia's Profile: http://www.excelforum.com/member.php...o&userid=30300
View this thread: http://www.excelforum.com/showthread...hreadid=500588


Jim Rech

Copying the data from the other worksheet
 
To get a filename from a user try the Application.GetOpenFilename method.

Sub a()
Dim FName As Variant
FName = Application.GetOpenFilename("Excel files (*.xls),*.xls")
If FName = False Then
MsgBox "User canceled"
Else
Workbooks.Open FName
End If
End Sub


--
Jim
"Sylvia" wrote in
message ...
|
| Hi..
|
| I have to write one macro which will add a button allowing Copy
| function. This button should allow us to copy the whole contents of
| some another Excel file (containing single tab) into the currently open
| file.
|
| For this I also need to add a search box which will allow me to search
| and select the file in windows after clicking on the above button and
| then proceed further..
|
| Can anyone help me for this please?
|
| Thanks,
| Sylvia
|
|
| --
| Sylvia
| ------------------------------------------------------------------------
| Sylvia's Profile:
http://www.excelforum.com/member.php...o&userid=30300
| View this thread: http://www.excelforum.com/showthread...hreadid=500588
|




All times are GMT +1. The time now is 11:26 PM.

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