One way to do it by formulas would be

StartSerial - Formula - "=1"    Cell Format - Custom "00000"
EndSerial   - Formula - "=Qty"  Cell Format - Custom "00000"
Date        -                   Cell Format - Custom "yymmdd"

Having done this, you can programmatically read the cell contents as
displayed using the Text() method of range class.

By the way, any particular reason for not wanting to do this by formula.

Regards

Ajit

-----Original Message-----
From: excel-macros@googlegroups.com [mailto:excel-mac...@googlegroups.com]
On Behalf Of Basta
Sent: Wednesday, August 05, 2009 4:22 PM
To: MS EXCEL AND VBA MACROS
Subject: $$Excel-Macros$$ auto fill start/end serial numbers and date when
qty entered


good day everyone,
i need some help with little script, actually i need script to auto
fill serial numbers when qty is entered.
lets say i type in F530 product qty, 5, and i need that in H530 will
be start serial number,
starts with zero: 00001, and in I530 stop serial number: 00005.
cells J and K empty, but in L i need date in this format: yymmdd.
and i need to fill it line by line, no copy down formulas :)

not sure, but only thing i found is date script, which is:
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("F:F")) Is Nothing Then
With Target
If .Value <> "" Then
.Offset(0, 6).Value = Format(Now, "yymmdd")
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub


thank you for your help!




--~--~---------~--~----~------------~-------~--~----~
----------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 5,200 subscribers worldwide and receive many nice notes about the 
learning and support from the group. Our goal is to have 10,000 subscribers by 
the end of 2009. Let friends and co-workers know they can subscribe to group at 
http://groups.google.com/group/excel-macros/subscribe
-~----------~----~----~----~------~----~------~--~---

Reply via email to