Remove Formula & then fill back

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
1,213
Office Version
  1. 2010
Platform
  1. Windows
  2. 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
Generate.xlsx
ABCDEFGHIJKLMNOPQ
101/12/2023 9:15:00 AM01/12/2023 3:30:00 PM
2
3ABC42200
44220042100422004230042850
5
6
7a100100555555335050
8b555555222222556060
9c99999910010022227070
10d2222222020118080
11e5050505050509090
12f22222222
13g6666666699996666
14h5454545488885454
15i20202020552020
16j999999121255100100
G
Cell Formulas
RangeFormula
D4D4=D3
O7:O16,L7:L16,I7:I16,F7:F16F7=G7
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,214,523
Messages
6,120,039
Members
448,940
Latest member
mdusw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top