A netizen asked me for help today. He wants to fill it out in Excel
Pdaa20124527000001
Pdaa2012452721302
Pdaa20124527000003
This sequence cannot be intelligently filled in Excel.
This can be done by writing VBA code, but I am not familiar with VBA and I still wrote one using JavaScript.
<Form> <p> <font color = "blue" size = "+ 2"> sequence generator v0.0.0001 </font> </P> <p> fixed part: <input type = "text" id = "txtfixed" value = "pdaa20124527"/> </P> <p> start value: <input type = "text" id = "txtbegin" value = "1"> end value: <input type = "text" id = "txtend" value = "999999"> step size: <input type = "text" id = "txtstep" value = "1"> <input type = "button" value = "generate sequence" onclick = "gencode (); "> </P> </form> <script language =" JavaScript "> function gencode () {sfixed = (Document. getelementbyid ("txtfixed"). value; If (0 = sfixed. Length) {If (! Confirm ("no fixed part indicated! \ N: Do you want to continue generating? ") {Return ;}} istart = (document. getelementbyid ("txtbegin ")). value; If (0 = istart. length) {alert ("start value not indicated! "); Return;} istart = istart/1; iend = (document. getelementbyid ("txtend ")). value; If (0 = iend. length) {alert ("no end value is specified! "); Return;} iend = iend/1; istep = (document. getelementbyid (" txtstep "). value; If (0 = istep. Length) {If (! Confirm ("no end value is specified! \ N must be 1 by default. Will the generation continue? ") {Return ;}} istep = istep/1; genserialcode ();} function genserialcode () {document. write ('<form name = "frmtest">'); document. write ('<textarea rows = "30" Cols = "90" name = "tatest">'); for (I = istart; I <iend + 1; I + = istep) {document. write (sfixed); var J = I; while (j = J * 10) <iend) {// document. writeln ("J =" + J); document. write ("0");} document. writeln (I);} document. write ('<\/textarea> <\/form>'); var tempval = eval ("document. frmtest. tatest "commandid tempval.focus(%%%%%tempval.select(%%%therange%tempval.createtextrange(%%%therange.exe ccommand (" copy ") ;}</SCRIPT>
Improved:
<Form> <p> <font color = "blue" size = "+ 2"> sequence generator v0.0.0001 </font> </P> <p> fixed part: <input type = "text" id = "txtfixed" value = "pdaa20124527"/> </P> <p> start value: <input type = "text" id = "txtbegin" value = "1"> end value: <input type = "text" id = "txtend" value = "999999"> step size: <input type = "text" id = "txtstep" value = "1"> <input type = "button" value = "generate sequence" onclick = "gencode (); "> </P> </form> <script language =" JavaScript "> function gencode () {sfixed = (Document. getelementbyid ("txtfixed"). value; If (0 = sfixed. Length) {If (! Confirm ("no fixed part indicated! \ N: Do you want to continue generating? ") {Return ;}} istart = (document. getelementbyid ("txtbegin ")). value; If (0 = istart. length) {alert ("start value not indicated! "); Return;} istart = istart/1; iend = (document. getelementbyid ("txtend ")). value; If (0 = iend. length) {alert ("no end value is specified! "); Return;} iend = iend/1; istep = (document. getelementbyid (" txtstep "). value; If (0 = istep. Length) {If (! Confirm ("no end value is specified! \ N must be 1 by default. Will the generation continue? ") {Return ;}} istep = istep/1; genserialcode ();} function genserialcode () {document. write ('<form name = "frmtest">'); document. write ('<textarea rows = "30" Cols = "90" name = "tatest">'); var J, imaxlen = string (iend ). length; for (I = istart; I <iend + 1; I + = istep) {document. write (sfixed); var ilen = imaxlen-string (I ). length; For (j = 0; j <ilen; j ++) {// document. writeln ("J =" + J); document. write ("0");} document. writeln (I);} document. write ('<\/textarea> <\/form>'); var tempval = eval ("document. frmtest. tatest "commandid tempval.focus(%%%%%tempval.select(%%%therange%tempval.createtextrange(%%%therange.exe ccommand (" copy ") ;}</SCRIPT>