in ahk, "xl.ActiveCell.Value := xl.ActiveCell.Value + 1" not worked if cell is date.
in VBE, "activeCell = activeCell + 1" can deal both num and date.
so is Ahk has a similar simple method can deal both number and date??
I see xl.ActiveCell.Value(11) has mor info By XML,
I don't know is neccessary to deal XML and how to do
Thanks very much!!!
ActiveCell.value+1 not worked if cell is date.
Re: ActiveCell.value+1 not worked if cell is date.
This works for me:
Code: Select all
oExcel.ActiveCell.NumberFormat := "########"
oExcel.ActiveCell.value := oExcel.ActiveCell.value + 1
oExcel.ActiveCell.NumberFormat := "gg/MM/aaaa" ; European date
;~ or
;~ oExcel.ActiveCell.NumberFormat := "MM/dd/yyyy" ; USA date ( I think )
____________________________________________________________________________
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode
Re: ActiveCell.value+1 not worked if cell is date.
How about to use CDate function of VBA ? though I have never used it at AHK
Re: ActiveCell.value+1 not worked if cell is date.
this can work well for date, thanks!!Odlanir wrote: ↑14 Apr 2019, 04:40This works for me:Code: Select all
oExcel.ActiveCell.NumberFormat := "########" oExcel.ActiveCell.value := oExcel.ActiveCell.value + 1 oExcel.ActiveCell.NumberFormat := "gg/MM/aaaa" ; European date ;~ or ;~ oExcel.ActiveCell.NumberFormat := "MM/dd/yyyy" ; USA date ( I think )