Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default 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
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
Copy cells from one file into another Lenchik Excel Worksheet Functions 1 October 23rd 08 09:47 AM
copy cells from one file to another file John Excel Discussion (Misc queries) 3 February 1st 08 09:24 PM
copy of formula contains file names into other cells Turk Excel Worksheet Functions 2 March 6th 07 01:14 AM
how can I copy file names into cells SAM SEBAIHI Excel Discussion (Misc queries) 5 January 20th 07 06:55 PM
how can you copy cells from one book to a shared file cityboy Excel Worksheet Functions 0 November 8th 05 05:26 PM


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