Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default Need to IMPORT a Worksheet From another WorkBook

I need to IMPORT an worksheet named "Report" in a workbook called
SendCom.xls. The worksheet that I am trying to update is called "sendcom" in
a workbook called GraphSendCom. I attempted doing this with the following
Macro but it does not work.

Any help would be greatly appreciated.

Sub main()

Dim destCell As Range
Dim totConspWkbk As Workbook

With Workbooks("GraphSendCom.xls").Worksheets("sendcom" )
.UsedRange.Clear
Set destCell = .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0)
End With

Workbooks.OpenText Filename:="G:\Gas_Control\EXCEL\DEPT\EOD @ Web
Reports\@ Web SendCom\sendcom.xls", _
Origin:=xlWindows, _
StartRow:=1, DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(8, 1), _
Array(30, 1), Array(41, 1), Array(67, 1), Array(78, 1))

Set GraphSendCom = ActiveWorkbook

ActiveSheet.UsedRange.Copy _
Destination:=destCell

GraphSendCom.Close savechanges:=False

Application.Goto destCell, Scroll:=True

ActiveSheet.UsedRange.Columns.AutoFit
Close
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Need to IMPORT a Worksheet From another WorkBook

First open the excel file in which you would like to get the worksheet
imported (SendCom.xls).
Right click on "Report" worksheet, click on "Move or Copy", you will get a
small window. Select your file name (under "To book" dropdown) where you
would like to get your present worksheet to be imported (that will be
SendCom.xls).
Then click on the name of the worksheet before which you would like to get
your REPORT worksheet (under "before sheet").
To create a copy click on the check box saying "create a copy" and then
press OK.
Hope this is what you want......
Just trying to help

"Krefty" wrote:

I need to IMPORT an worksheet named "Report" in a workbook called
SendCom.xls. The worksheet that I am trying to update is called "sendcom" in
a workbook called GraphSendCom. I attempted doing this with the following
Macro but it does not work.

Any help would be greatly appreciated.

Sub main()

Dim destCell As Range
Dim totConspWkbk As Workbook

With Workbooks("GraphSendCom.xls").Worksheets("sendcom" )
.UsedRange.Clear
Set destCell = .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0)
End With

Workbooks.OpenText Filename:="G:\Gas_Control\EXCEL\DEPT\EOD @ Web
Reports\@ Web SendCom\sendcom.xls", _
Origin:=xlWindows, _
StartRow:=1, DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(8, 1), _
Array(30, 1), Array(41, 1), Array(67, 1), Array(78, 1))

Set GraphSendCom = ActiveWorkbook

ActiveSheet.UsedRange.Copy _
Destination:=destCell

GraphSendCom.Close savechanges:=False

Application.Goto destCell, Scroll:=True

ActiveSheet.UsedRange.Columns.AutoFit
Close
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Need to IMPORT a Worksheet From another WorkBook

Check your other post, too.

Krefty wrote:

I need to IMPORT an worksheet named "Report" in a workbook called
SendCom.xls. The worksheet that I am trying to update is called "sendcom" in
a workbook called GraphSendCom. I attempted doing this with the following
Macro but it does not work.

Any help would be greatly appreciated.

Sub main()

Dim destCell As Range
Dim totConspWkbk As Workbook

With Workbooks("GraphSendCom.xls").Worksheets("sendcom" )
.UsedRange.Clear
Set destCell = .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0)
End With

Workbooks.OpenText Filename:="G:\Gas_Control\EXCEL\DEPT\EOD @ Web
Reports\@ Web SendCom\sendcom.xls", _
Origin:=xlWindows, _
StartRow:=1, DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(8, 1), _
Array(30, 1), Array(41, 1), Array(67, 1), Array(78, 1))

Set GraphSendCom = ActiveWorkbook

ActiveSheet.UsedRange.Copy _
Destination:=destCell

GraphSendCom.Close savechanges:=False

Application.Goto destCell, Scroll:=True

ActiveSheet.UsedRange.Columns.AutoFit
Close
End Sub


--

Dave Peterson
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
IMPORT DATA from the same Workbook Ananth Excel Discussion (Misc queries) 1 August 1st 07 06:08 AM
Import Data from the Same Workbook Ananth Excel Discussion (Misc queries) 1 February 20th 07 01:42 PM
Import data into my workbook [email protected] Excel Worksheet Functions 1 April 14th 06 03:41 AM
i want to import data from one workbook to another and add a row wdaw924 Excel Worksheet Functions 0 January 16th 06 03:28 PM
Conditional import of data from other workbook or worksheet Bengt Bergholm Excel Discussion (Misc queries) 1 October 14th 05 12:05 PM


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