latinsbest
03-12-2013, 12:45 PM
Hello community I have searched a bit on this subject and I think I haven't used the proper wording or the question simply has not been asked yet.
I will try to lay out the situation to the best of my ability.
Column A (A2:A100) has the dates. A2 being 3/12/2013 and A100 being 6/18/2013. Column B will be the result column.
N12 Is the control number and N13 the identifier.
N12 is a number that will be entered manually on a daily basis.
N13 contains the current date *Today ()*.
I want to create a macro to then be executed with a button on this sheet. (I know how to link the macro to a button)
Macro:
I would like the macro to compare N13 to column A and whatever cell that matches the date on N13 then would copy N12 to the adjacent cell on Column B.
Example:
If I enter 50 in the control number (N12) and click the button, the macro will find the date in N13 on column A, in this example A5, and enter 50 in B5.
Edit: I got this to work but I need the macro to verify the whole column and produce the result on the adjecent column
Sheets("Control").Activate
If Sheets("control").Range("a5") = Sheets("control").Range("n13") Then
Sheets("control").Range("b5") = Sheets("control").Range("n12")
End If
I will try to lay out the situation to the best of my ability.
Column A (A2:A100) has the dates. A2 being 3/12/2013 and A100 being 6/18/2013. Column B will be the result column.
N12 Is the control number and N13 the identifier.
N12 is a number that will be entered manually on a daily basis.
N13 contains the current date *Today ()*.
I want to create a macro to then be executed with a button on this sheet. (I know how to link the macro to a button)
Macro:
I would like the macro to compare N13 to column A and whatever cell that matches the date on N13 then would copy N12 to the adjacent cell on Column B.
Example:
If I enter 50 in the control number (N12) and click the button, the macro will find the date in N13 on column A, in this example A5, and enter 50 in B5.
Edit: I got this to work but I need the macro to verify the whole column and produce the result on the adjecent column
Sheets("Control").Activate
If Sheets("control").Range("a5") = Sheets("control").Range("n13") Then
Sheets("control").Range("b5") = Sheets("control").Range("n12")
End If