Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to update data from multiple sheets to one specific sheets | Excel Discussion (Misc queries) | |||
need help please inserting multiple rows based on cell value then copying to data sheet | Excel Worksheet Functions | |||
Inserting a single row to separate data multiple times | Excel Discussion (Misc queries) | |||
Multiple Sheets (Need to create 500 individual sheets in one workbook, pulling DATA | Excel Worksheet Functions | |||
Inserting Sheets from multiple files | Excel Discussion (Misc queries) |