Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear Experts,
I want to extract data from different workbooks into target workbook. I want to do it in following steps. 1. After clicking the command button, it should asks for the source workbook 2. Once I browse and select the source workbook, it copies the data based on the specified conditions and paste it into the target workbook. I would appcreciate of somebody can help me on this. If this stuff is been discussed earlier, please send me the links. I couldn't locate it as of now. Thanks, Chatur |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this...
Private Sub CommandButton1_Click() Dim FName As String, Ws As Worksheet, Wb As Workbook Set Ws = ActiveSheet FName = Application.GetOpenFilename( _ FileFilter:="Excel Files (*.xls), *.xls") If FName < "False" Then Set Wb = Workbooks.Open(FName) Else Exit Sub End If Wb.Sheets(1).Range("A1").Copy Ws.Range("A1") Wb.Close SaveChanges:=False End Sub -- Dan Oakes |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dan,
Thanks a lot for your help. I was able to do it. :) Regards, Har**** On Jun 20, 3:38 pm, "Dan R." wrote: Try this... Private Sub CommandButton1_Click() Dim FName As String, Ws As Worksheet, Wb As Workbook Set Ws = ActiveSheet FName = Application.GetOpenFilename( _ FileFilter:="Excel Files (*.xls), *.xls") If FName < "False" Then Set Wb = Workbooks.Open(FName) Else Exit Sub End If Wb.Sheets(1).Range("A1").Copy Ws.Range("A1") Wb.Close SaveChanges:=False End Sub -- Dan Oakes |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
extracting data from master sheet into sub sheets and automatic updating. | Links and Linking in Excel | |||
Extracting data from Excel | Excel Worksheet Functions | |||
Extracting Data back and forth between Sheets | Excel Worksheet Functions | |||
extracting data from excel | Excel Programming | |||
Excel VBA extracting data | Excel Programming |