Ok I have 2 sheets on sheet1 cell A1 I will enter date and in B1 a value, A1 and B1 change; on sheet2 on column A are dates(every day of the year) and column B is empty. I would like a macro to search on sheet2 column A for the date I put in sheet1 cell A1 and copy the value from B1 to sheet2 column B next to the according date.
This is what I use atm but if I do it like this I have to write that again and again for every day of the year so I need help to make a code to avoid that.
In this example C1=A1 from sheet2.
This is what I use atm but if I do it like this I have to write that again and again for every day of the year so I need help to make a code to avoid that.
In this example C1=A1 from sheet2.
Code:
Sub test()
**Sheets("Sheet1").Select
If Range("A1") = Range("C1") Then
If Range("B1").Value > "0" Then
Range("B1").Copy
Sheets("Sheet2").Select
Range("B1").PasteSpecial xlPasteValues
else
end if
else
end if
end sub