B
Becky
I am trying to automate copying data from one workbook into another
workbook. The source book, and the various sheets and cells within it, will
be different each time. The destination book, however, with only one sheet,
will always be the same.
The user manually opens the source workbook, activates the desired sheet and
selects the cell containing the name of the item he wants. The selected
cell is always in row 3 of the desired column. I need to copy that column
and the column immediately to its right as well as column A and paste the 3
columns into the destination workbook.
I have the following code to get the info regarding the source workbook:
Dim GlazeFile As String
Dim GlazeSheet As String
Dim GlazeCell As String
Dim MyPrintFile As String
'Get the full path and name of the file
GlazeFile = ActiveWorkbook.FullName
'Get the worksheet tab name
GlazeSheet = ActiveSheet.Name
'Get the active cell(s)
GlazeCell = ActiveWindow.RangeSelection.Address
Then I have code which checks to see if the destination file is open and
opens the file if it is not.
'Determine whether destination file is open. If not, open the file.
Dim MyPrintFile As String
MyPrintFile = "Glaze_Print.xls"
On Error Resume Next
x = UCase(Workbooks(MyPrintFile).Name)
If Err = 0 Then
MsgBox MyPrintFile & " is open."
Else
Workbooks.Open "c:\Matts\Glazes\" & MyPrintFile
End If
After hours of searching newsgroups, on-line help, and trying various code,
I can't figure out the code needed to copy the 3 columns of data from the
source book and paste it into the destination book. A recent poster asked a
similar question, but I'm not savvy enough to be able to translate that
answer to my situation.
Would someone help me with this please? Thank you.
Excel 2003 Windows XP
Becky
workbook. The source book, and the various sheets and cells within it, will
be different each time. The destination book, however, with only one sheet,
will always be the same.
The user manually opens the source workbook, activates the desired sheet and
selects the cell containing the name of the item he wants. The selected
cell is always in row 3 of the desired column. I need to copy that column
and the column immediately to its right as well as column A and paste the 3
columns into the destination workbook.
I have the following code to get the info regarding the source workbook:
Dim GlazeFile As String
Dim GlazeSheet As String
Dim GlazeCell As String
Dim MyPrintFile As String
'Get the full path and name of the file
GlazeFile = ActiveWorkbook.FullName
'Get the worksheet tab name
GlazeSheet = ActiveSheet.Name
'Get the active cell(s)
GlazeCell = ActiveWindow.RangeSelection.Address
Then I have code which checks to see if the destination file is open and
opens the file if it is not.
'Determine whether destination file is open. If not, open the file.
Dim MyPrintFile As String
MyPrintFile = "Glaze_Print.xls"
On Error Resume Next
x = UCase(Workbooks(MyPrintFile).Name)
If Err = 0 Then
MsgBox MyPrintFile & " is open."
Else
Workbooks.Open "c:\Matts\Glazes\" & MyPrintFile
End If
After hours of searching newsgroups, on-line help, and trying various code,
I can't figure out the code needed to copy the 3 columns of data from the
source book and paste it into the destination book. A recent poster asked a
similar question, but I'm not savvy enough to be able to translate that
answer to my situation.
Would someone help me with this please? Thank you.
Excel 2003 Windows XP
Becky