LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Inserting Data: Multiple Sheets

I'm using the code below to retreive data from multiple workbooks. However when the data is received, it deletes the headings that I have in place. What can I add that will place the data in a particular sheet and cell number on the new worksheet receiving the information. Thank

Sub TestFile4(
Dim basebook As Workboo
Dim mybook As Workboo
Dim sourceRange As Rang
Dim destrange As Rang
Dim rnum As Lon
Dim a As Lon
Dim FNames As Strin
Dim MyPath As Strin
Dim SaveDriveDir As Strin

SaveDriveDir = CurDi
MyPath = "X:\Reports2K\Reports\Daily\sg
ChDrive MyPat
ChDir MyPat
FNames = Dir("*.xls"
If Len(FNames) = 0 The
MsgBox "No files in the Directory
ChDrive SaveDriveDi
ChDir SaveDriveDi
Exit Su
End I

Application.ScreenUpdating = Fals
Set basebook = ThisWorkboo
rnum =
Do While FNames < "
If Left(FNames, 18) = "SuperGroup2_200402" The
Set mybook = Workbooks.Open(FNames
Set sourceRange = mybook.Worksheets(2).Range("B45:N45"
a = sourceRange.Rows.Coun
Set destrange = basebook.Worksheets(2).Cells(rnum, 1

sourceRange.Copy destrang
rnum = rnum +
mybook.Close Fals
End I
FNames = Dir(
Loo
ChDrive SaveDriveDi
ChDir SaveDriveDi
Application.ScreenUpdating = Tru
End Sub
 
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
How to update data from multiple sheets to one specific sheets Khawajaanwar Excel Discussion (Misc queries) 4 January 15th 10 07:31 AM
need help please inserting multiple rows based on cell value then copying to data sheet [email protected] Excel Worksheet Functions 1 July 1st 07 08:44 PM
Inserting a single row to separate data multiple times Luthdawg Excel Discussion (Misc queries) 2 April 19th 07 09:02 PM
Multiple Sheets (Need to create 500 individual sheets in one workbook, pulling DATA Amaxwell Excel Worksheet Functions 4 August 17th 06 06:23 AM
Inserting Sheets from multiple files fgwiii Excel Discussion (Misc queries) 2 November 2nd 05 08:47 PM


All times are GMT +1. The time now is 05:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"