hsandeep
Well-known Member
- Joined
- Dec 6, 2008
- Messages
- 1,213
- Office Version
- 2010
- Platform
- Windows
- Mobile
A1 & B1 generates time value.
D4 generates a numerical value
1st range is F4, F7:G16. F4 generates a numerical value & G7:G16 generates numerical values.
F7:F16 (by default) HasFormula & updates its values from G7:G16 using simple Excel function like =[R1C1] type (Example: F7=G7)
IF now>=$A$1 AND now<B1 AND F4>=$D$4 AND F7:F16 HasFormula then the vba code should REMOVE THE FORMULAS from F7:F16.
IF now>=B1 then AND F7:F16 DOES NOT HasFormula then the vba code should INSERT THE FORMULA in F7:F16 to get the values of G7:G16 of [R1C1] type.
Same above actions should be performed by the code for 2nd range i.e. I4, I7:J16; 3rd range i.e. L4, L7:M16 & 4th range i.e. O4, O7:P16
How to accomplish?
Thanks in advance
D4 generates a numerical value
1st range is F4, F7:G16. F4 generates a numerical value & G7:G16 generates numerical values.
F7:F16 (by default) HasFormula & updates its values from G7:G16 using simple Excel function like =[R1C1] type (Example: F7=G7)
IF now>=$A$1 AND now<B1 AND F4>=$D$4 AND F7:F16 HasFormula then the vba code should REMOVE THE FORMULAS from F7:F16.
IF now>=B1 then AND F7:F16 DOES NOT HasFormula then the vba code should INSERT THE FORMULA in F7:F16 to get the values of G7:G16 of [R1C1] type.
Same above actions should be performed by the code for 2nd range i.e. I4, I7:J16; 3rd range i.e. L4, L7:M16 & 4th range i.e. O4, O7:P16
How to accomplish?
Thanks in advance
Generate.xlsx | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | |||
1 | 01/12/2023 9:15:00 AM | 01/12/2023 3:30:00 PM | |||||||||||||||||
2 | |||||||||||||||||||
3 | ABC | 42200 | |||||||||||||||||
4 | 42200 | 42100 | 42200 | 42300 | 42850 | ||||||||||||||
5 | |||||||||||||||||||
6 | |||||||||||||||||||
7 | a | 100 | 100 | 555 | 555 | 3 | 3 | 50 | 50 | ||||||||||
8 | b | 555 | 555 | 222 | 222 | 5 | 5 | 60 | 60 | ||||||||||
9 | c | 999 | 999 | 100 | 100 | 22 | 22 | 70 | 70 | ||||||||||
10 | d | 222 | 222 | 20 | 20 | 1 | 1 | 80 | 80 | ||||||||||
11 | e | 50 | 50 | 50 | 50 | 50 | 50 | 90 | 90 | ||||||||||
12 | f | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | ||||||||||
13 | g | 66 | 66 | 66 | 66 | 99 | 99 | 66 | 66 | ||||||||||
14 | h | 54 | 54 | 54 | 54 | 88 | 88 | 54 | 54 | ||||||||||
15 | i | 20 | 20 | 20 | 20 | 5 | 5 | 20 | 20 | ||||||||||
16 | j | 999 | 999 | 12 | 12 | 5 | 5 | 100 | 100 | ||||||||||
G |
Cell Formulas | ||
---|---|---|
Range | Formula | |
D4 | D4 | =D3 |
O7:O16,L7:L16,I7:I16,F7:F16 | F7 | =G7 |