try like
change file path\name to suit, if you want leading zeros on your number, format to suit, num variable content can be inserted to any stringfn = "c:\temp\qwerty.txt" f = FreeFile Open fn For Input As f num = Val(Input(LOF(f), #f)) Close f Open fn For Output As f Print #f, num + 1 Close f
in this case total file content was assumed to be one number (66)