Link to home
Start Free TrialLog in
Avatar of cliffton jhed saldavia
cliffton jhed saldavia

asked on

How to sequentially Generate Request #(not randomize)

Hi Guys I just wanna ask.I do have here codes for generating Request # but its randomize and I need a combination of alpha-numberic characters that will generate request # by sequence not randomize and combine with aleast 2 letters.Please see the attached file below.
WO_Maintenance-Form.xlsm
Avatar of Shums Faruk
Shums Faruk
Flag of India image

Hi Cliffton,

Please change your code for Generate Request # to below, it will add +1 to the last number used in Col D of MainRecord Sheet.
Private Sub CommandButton8_Click()
    Dim Ws As Worksheet
    Dim r As Long
    Dim ReqNo As String
    Set Ws = Worksheets("MainRecord")
getNum:
    r = Ws.Cells(Ws.Rows.Count, "D").End(xlUp)
    ReqNo = r + 1
    If IsNumeric(Application.Match(ReqNo, Worksheets("MainRecord").Range("D:D"), False)) Then GoTo getNum
    On Error Resume Next
    Me.REQUESTNO.Value = ReqNo
End Sub

Open in new window

This is what you want?
WO_Maintenance-Form_v1.xlsm
Avatar of cliffton jhed saldavia
cliffton jhed saldavia

ASKER

GONNA try this one a moment Sir.THanks for the share.Gonna get back to you asap.
YEAH IT WORKS FINE SIR.But how can I combine it with an alpha-numberic character Sir.I was thinking that if I combine with alpha numberic char,my search box will not read it because its was only designed for numberic characters.Could check that one also.But somehow it works.I need to combine it with letters
ASKER CERTIFIED SOLUTION
Avatar of Shums Faruk
Shums Faruk
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
could you please check this one sir.
WO_Maintenance-Form.xlsm
On what ground you base Initials? Like in previous version you had LW, PL and so on.
well actually that's the code for the palaces in Qatar.2 letter only.I am try to combine the Req # and for example the LW in a single cell only.
Provided the best answer
How would I know for which location, you are generating WO? Alpha-Numeric is not a problem, but there should be any field in your UserForm, where we can link with Request No.

Like in your previous version you had field called CODES.

Please find attached the amendment in your previous version.
WO_Maintenance-Form_v2.xlsm
any way sir i think i will gonna stick to a combox box so that I can select a Palace Code.Anyway I already closed this Question maybe you can help me with my second question there.BDW Thank you so much for this.The 2nd question is how to make a login userform to record the login logout of the employee.You can check it .I already posted it.