I am new to vb script.I want to copy data from worksheets to a summary worksheet if date in summary worksheet matches the time in the different worksheets.the different worksheets contain hourly data for diff dates.Once i have all the data in a summary worksheet i can find the monthly average.in summary sheet i have the times in column A and IN "11013di" sheet i have the dates in D and data in E I tried this-
Public Sub MoveData()
Dim Summary As Worksheet
Dim Day As Worksheet
Dim DateRange As Range
Dim ValueRange As Range
Dim cell As Range
Set Summary = Sheets("Summary")
Set Day = Sheets("110131di")
Set DateRange = Summary.Range("D2")
Set ValueRange = Summary.Range("E2")
For i = 2 To 25
For j = 2 To 25
If Worksheets("110131di").Cells(4, i).Value = Sheets("Summary").Cells(1, j) Then
Sheets("Summary").Cells(2, j) = Worksheets("110131di").Cells(5, i)
Else
End If
Next j
Next i
End Sub
Bookmarks