Dear All,
I am trying to change some coding that was given to me before to no avail, I am trying to do the following, check each value in column A on daily data, and find the location of this value in sheet1, when it finds the value in sheet1 it will copy the value in column B on daily data for that item, and paste the value in the farmost column in sheet1(sheet1 columns are always complete block of data, but rows can have blanks, but would be no more than 250 rows), but I am getting confused with the coding, daily data sheet values in column A will always appear on sheet1.
Coding
Sub copythedata()
Dim Match As Object
Dim i As Integer
i = 1
With Worksheets("Sheet1".UsedRange.Columns(1)
Do
Set Match = .Find(Worksheets("Daily Data".Cells(i, 1), LookAt:=xlWhole)
If Not Match Is Nothing Then Worksheets("Daily Data".Cells(Match.Row, 2) _
= Worksheets("sheet1".Cells(i, 15)
i = i + 1
Loop While Not Len(Worksheets("daily Data".Cells(i, 1)) = 0
End With
Application.ScreenUpdating = True
End Sub
Any help will be greatly appreciated, I am sure the coding works as I used it on a similar example but cannot recreate it again.
Thanks in advance Thanks Rob.
I am trying to change some coding that was given to me before to no avail, I am trying to do the following, check each value in column A on daily data, and find the location of this value in sheet1, when it finds the value in sheet1 it will copy the value in column B on daily data for that item, and paste the value in the farmost column in sheet1(sheet1 columns are always complete block of data, but rows can have blanks, but would be no more than 250 rows), but I am getting confused with the coding, daily data sheet values in column A will always appear on sheet1.
Coding
Sub copythedata()
Dim Match As Object
Dim i As Integer
i = 1
With Worksheets("Sheet1".UsedRange.Columns(1)
Do
Set Match = .Find(Worksheets("Daily Data".Cells(i, 1), LookAt:=xlWhole)
If Not Match Is Nothing Then Worksheets("Daily Data".Cells(Match.Row, 2) _
= Worksheets("sheet1".Cells(i, 15)
i = i + 1
Loop While Not Len(Worksheets("daily Data".Cells(i, 1)) = 0
End With
Application.ScreenUpdating = True
End Sub
Any help will be greatly appreciated, I am sure the coding works as I used it on a similar example but cannot recreate it again.
Thanks in advance Thanks Rob.