• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Clearing Contents of the Cell and updating formula

Hi,
Please find the attached file.
There are 60 worksheets ( i am giving only 3 as an example )
I want to delete the column "C" " 10-Aug-2016" in every sheet.
In Column "D" "Growth / Degrowth" i want that everyday whenever i run the code the figure should change
for eg
on 10th Aug =C2-(B2/31*10)
on 11th Aug = C2-(B2/31*11)
on 12th Aug =C2-(B2/31*12) and so on.

I had written the code but its only deleting the cells but not calculating the growth/degrowth column.

Please help.

Thanks
Raj
 

Attachments

  • data1.xlsm
    20.5 KB · Views: 2
Hi !

Can't work with a bad logic (neither with a bad formula) :
column C must be cleared after formula !

According to your attachment :​
Code:
Sub Demo()
         Dim Ws As Worksheet
    For Each Ws In Worksheets
        With Range(Ws.[D2], Ws.Cells(4).End(xlDown))
            .Formula = "=C2-(B2/31*DAY($C$1))"
            .Formula = .Value
            .Offset(, -1).ClearContents
        End With
    Next
End Sub
Do you like it ? So thanks to click on bottom right Like !
 
Back
Top