Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Copy cells from one file into another
Hello,
what would be the easiest way to go through the a column in one file and find all the times that exceed 15 minutes, pull up the cells within that row with names and record these cells into another file after the last filled row.... Here's a part of the code I am trying to write.... it only records the cells of the latest time it finds into the row 251, not the first available one :( Dim aPath, aRange, aSheet As String Dim R, i, j As Integer aPath = "\\servername\" aFile = "FileName.xls" aSheet = "SheetName" Dim mybook As Workbook, xlsheet As Worksheet Set mybook = Workbooks.Open(aPath & aFile) For i = 3 To 250 respTime = mybook.Worksheets(hdSheet).Range("H" & i).Value If (respTime < "") Then respMins = Hour(respTime) * 60 + Minute(respTime) If (respMins 15) Then ' doesn't work as I want it R = Range("A65536").End(xlUp).Offset(1, 0).Row Worksheets("Weekly").Cells(R, 1) = mybook.Worksheets(hdSheet).Range("E" & i).Value Worksheets("Weekly").Cells(R, 2) = mybook.Worksheets(hdSheet).Range("H" & i).Value Worksheets("Weekly").Cells(R, 3) = mybook.Worksheets(hdSheet).Range("B" & i).Value End If End If Next i mybook.Close savechanges:=False |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy cells from one file into another | Excel Worksheet Functions | |||
copy cells from one file to another file | Excel Discussion (Misc queries) | |||
copy of formula contains file names into other cells | Excel Worksheet Functions | |||
how can I copy file names into cells | Excel Discussion (Misc queries) | |||
how can you copy cells from one book to a shared file | Excel Worksheet Functions |