ExcelMike21
New Member
- Joined
- Mar 30, 2020
- Messages
- 6
- Office Version
- 365
- 2016
- 2013
- Platform
- Windows
- Mobile
Hi
Found some really useful tips on the board but this is my first post as I cannot find the answer after searching.
As above, I am trying to write a vba that will do the following:
If any cells in range C8:C32 are blank, then I would like to automatically clear the contents in the adjacent cells in columns D:T.
For example, if C8 is blank, I need to automatically clear contents in cells D8:T8, however, it then needs to look at C9, C10 all the way through to C32 (regardless of what the previous event was for the row above).
For context, range C8:C32 (named "Dates"), contains dates that are automatically populated each month, however, they move up or down depending on the day of the month. i.e. Wednesday 1st April would start in C10 (C8 being Monday, C9 being Tuesday). Please also note, when I say C8:C32 are blank, I mean they contain a formula that is currently showing the cell to be blank, not fully empty.
I have played around with various things I've seen on the forum and the closest I can get is as follows:
But, I'm struggling to get the above to work for the full range of cells and it's as if I would need to type that out for every cell/row I want it to apply to (and I know there must be a simpler way!)
Really appreciate any help or advice.
Please let me know if you need more information or if anything doesn't make sense!
Thanks,
Michael
Found some really useful tips on the board but this is my first post as I cannot find the answer after searching.
As above, I am trying to write a vba that will do the following:
If any cells in range C8:C32 are blank, then I would like to automatically clear the contents in the adjacent cells in columns D:T.
For example, if C8 is blank, I need to automatically clear contents in cells D8:T8, however, it then needs to look at C9, C10 all the way through to C32 (regardless of what the previous event was for the row above).
For context, range C8:C32 (named "Dates"), contains dates that are automatically populated each month, however, they move up or down depending on the day of the month. i.e. Wednesday 1st April would start in C10 (C8 being Monday, C9 being Tuesday). Please also note, when I say C8:C32 are blank, I mean they contain a formula that is currently showing the cell to be blank, not fully empty.
I have played around with various things I've seen on the forum and the closest I can get is as follows:
VBA Code:
But, I'm struggling to get the above to work for the full range of cells and it's as if I would need to type that out for every cell/row I want it to apply to (and I know there must be a simpler way!)
Really appreciate any help or advice.
Please let me know if you need more information or if anything doesn't make sense!
Thanks,
Michael