The Brown Growler
Registered User.
- Local time
- Today, 04:56
- Joined
- May 24, 2008
- Messages
- 85
Hi,
Would anyone please be able to help me with some VBA code to repetitively clear the contents of a cell range in an excel worksheet subject to some values in other cells of the same worksheet ?
In cell E2 I have two possible values, "In Play" or "Not In Play" (quotations marks only for illustation, not actually part of value) and in cell F2 I have one possible value, "Suspended".
In column T for cells T5 to T25 I can have 4 possible values, "PLACED", "PENDING", "CANCELLED" or a numerical value.
The worksheet is constantly refreshed from an external data source and I hope to be able to use something like an event property or similar that will react to the sheet refreshing or recalculating to initiate the VBA code.
If the cell contents in range T5 to T25 contain any value other that "PENDING" then I wish to clear the cell contents if E2 = "Not In Play" and F2 <> "Suspended".
If F2 = "Suspended" or "E2" = "In Play" I do not wish the cell contents in the range T5 to T25 to be cleared.
I think that I need some type of nested IF statement but just do not know where to start. I can open the VBA editor and paste the code into the specific worksheet but I am stuck with the code.
Thx & Rgds
Growlos
Would anyone please be able to help me with some VBA code to repetitively clear the contents of a cell range in an excel worksheet subject to some values in other cells of the same worksheet ?
In cell E2 I have two possible values, "In Play" or "Not In Play" (quotations marks only for illustation, not actually part of value) and in cell F2 I have one possible value, "Suspended".
In column T for cells T5 to T25 I can have 4 possible values, "PLACED", "PENDING", "CANCELLED" or a numerical value.
The worksheet is constantly refreshed from an external data source and I hope to be able to use something like an event property or similar that will react to the sheet refreshing or recalculating to initiate the VBA code.
If the cell contents in range T5 to T25 contain any value other that "PENDING" then I wish to clear the cell contents if E2 = "Not In Play" and F2 <> "Suspended".
If F2 = "Suspended" or "E2" = "In Play" I do not wish the cell contents in the range T5 to T25 to be cleared.
I think that I need some type of nested IF statement but just do not know where to start. I can open the VBA editor and paste the code into the specific worksheet but I am stuck with the code.
Thx & Rgds
Growlos