Update
@boiler @flyingDman
I have taken the code given by
@mikeyww from one of my previous questions
(
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=93171&p=412577#p412577 )
And the code ( I think I did some modifications to it ) given by flyingDman and came up with this
Code: Select all
ini := StrReplace(A_ScriptFullPath, ".ahk", ".ini"), track := "Track"
IniRead, year , %ini%, %track%, year
IniRead, month, %ini%, %track%, month
IniRead, runs , %ini%, %track%, runs, 0
If (year != A_YYYY || month != A_MM) {
IniWrite, %A_YYYY% , %ini%, %track%, year
IniWrite, %A_MM% , %ini%, %track%, month
IniWrite, % runs := 1, %ini%, %track%, runs
} Else IniWrite, % ++runs , %ini%, %track%, runs
MsgBox = %runs%
xl := ComObjCreate("excel.application")
wrkbk := xl.workbooks.open("C:\Users\user\Desktop\LoL.xlsx")
lstrw := xl.Range("A" xl.Rows.Count).End(-4162).Row
mnth := strsplit(xl.Range("A" lstrw).value, "-").2
nrw := (mnth = a_mm) ? lstrw : lstrw + 1
nmbr:= xl.Range("A" lstrw).value
xl.Range("A" nrw):= MsgBox
xl.Range("A" nrw).NumberFormat := "##"
wrkbk.close(1)
xl.quit()
This is resetting the count to 1 when the month changes
But I am unable to give a gap ( between "10" and "1")
Can someone please guide me ?