racheltaylor
New Member
- Joined
- Aug 10, 2013
- Messages
- 7
Hi
I am relatively new to VBA with basic knowledge and need help writing a macro..
I have text in column V of my worksheet, the value of cells in column V is either "Clear", "Pending" or blank "".
I want to write a macro that will input the date the current date into columns U and W IF the value in V on the same row = "Clear" and columns W and V are blank, and ONLY if they are blank. I don't want to override previous dates.
I need the date to be static so I thought copying and pasting values from Today() would produce a static date...
If the values in column V = "pending" or "" then nothing is to happen to the adjacent cells in columns W and V
My problem is I'm not sure how to indicate a range in VBA i.e. column V, as the range is constantly growing.
Any help with this would be much appreciated!
[TABLE="width: 500"]
<tbody>[TR]
[TD]U[/TD]
[TD]V[/TD]
[TD]W[/TD]
[/TR]
[TR]
[TD]Response Date[/TD]
[TD]Result [/TD]
[TD]Date Emailed[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Clear[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Clear[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Clear[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Clear[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Pending[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Clear[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I am relatively new to VBA with basic knowledge and need help writing a macro..
I have text in column V of my worksheet, the value of cells in column V is either "Clear", "Pending" or blank "".
I want to write a macro that will input the date the current date into columns U and W IF the value in V on the same row = "Clear" and columns W and V are blank, and ONLY if they are blank. I don't want to override previous dates.
I need the date to be static so I thought copying and pasting values from Today() would produce a static date...
If the values in column V = "pending" or "" then nothing is to happen to the adjacent cells in columns W and V
My problem is I'm not sure how to indicate a range in VBA i.e. column V, as the range is constantly growing.
Any help with this would be much appreciated!
[TABLE="width: 500"]
<tbody>[TR]
[TD]U[/TD]
[TD]V[/TD]
[TD]W[/TD]
[/TR]
[TR]
[TD]Response Date[/TD]
[TD]Result [/TD]
[TD]Date Emailed[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Clear[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Clear[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Clear[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Clear[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Pending[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Clear[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]