I'm new to VBA :', I wonder if I could use the If AND function within VBA. When columns C and D are filled with values, VBA will automatically copy columns A, B, and E and paste them to another sheet. Plus if it is possible i want to make it dynamic.
For example, I have this table in Sheet1:
| Name | Phone# | Class | Graduated | Score |
|---|---|---|---|---|
| Ariana | 749142 | 9 | Yes | 3.6 |
| Brian | 454364 | 3.7 | ||
| Harry | 143246 | 12 | Yes | 4 |
| Mady | 356647 | 10 | 2.9 |
Columns C and D need to have a value inside both cells, then VBA will copy columns A, B, and E to columns A, B, and C in Sheet2.
However, VBA will do nothing with the row if:
only one column has value (e.g. row 5)
both columns have no value (e.g. row 3)
I hope it make sense :)
View Code> paste code into sheet1 moduleMicrosoft documentation:
Update: