Dear all,
I am a vba noob, just started building a userform for a month, able to send all the data to excel sheet, able to perform search function and recall back to another userform and etc
I need your help on the below scenarios, I was trying to google the answer for a few hours and couldn't find any solution close to my requirements.
I tried to user formula to get what I needed once the data was input by users and saved to the worksheet.
=IF(B2<>"",IF(B2="Complaint","C","E")&IF(A2<>"",MID(YEAR(J2),3,2)&TEXT(J2,"mm")&ExtractCap(G2)&TEXT(K2,"hhmmss"),""),"")
where B2 =
G2 = name
K2 = start time
J2 = time
However, I want to show same code on userform before users save data to excel sheet. (i.e. create a unique code base on what users input into the userform before saved to worksheet)
I created a "Start Call" button to generate current time and current date on two different textbox.
A combo box for users to pick "handled by" (i.e. name of handler), lets say the names are :
Pxxx Lxxx
Cxxx Mxxx
Cxxx Cxxx
Nxxx Cxxx
A combo box for users to pick enquiry type,
Complaint
Product Enquiry
Endorsement Enquiry
Claims Enquiry
Sales Enquiry
General Enquiry
The unique code should be generated when above fields are filled (or not empty you could call that)
e.g. E1710PL003651 and C1710NC003823
1st letter, C = Complaint, otherwise E = other enquires
17 = YY, extract year from date
10 = MM in digital, extract month from date
6th - 7th letter, the initial of handlers, i.e. PL or NC
the digital behind is just the current time in hhmmss format
If one of these fields are empty, label or text box could show "Not enough info to generate code"
All I could think of its to use if functions for each fields and generate a value
Then a label or textbox to show a combination of different values.
But I couldn't get the data to show on the label when the "handle by" is not empty and not sure how to set up values for each fields.
It would be great if any of you experts could advise or give me some ideas how to tackle such issue, thankyou all in advance!
Regards
Tom
I am a vba noob, just started building a userform for a month, able to send all the data to excel sheet, able to perform search function and recall back to another userform and etc
I need your help on the below scenarios, I was trying to google the answer for a few hours and couldn't find any solution close to my requirements.
I tried to user formula to get what I needed once the data was input by users and saved to the worksheet.
=IF(B2<>"",IF(B2="Complaint","C","E")&IF(A2<>"",MID(YEAR(J2),3,2)&TEXT(J2,"mm")&ExtractCap(G2)&TEXT(K2,"hhmmss"),""),"")
where B2 =
G2 = name
K2 = start time
J2 = time
However, I want to show same code on userform before users save data to excel sheet. (i.e. create a unique code base on what users input into the userform before saved to worksheet)
I created a "Start Call" button to generate current time and current date on two different textbox.
A combo box for users to pick "handled by" (i.e. name of handler), lets say the names are :
Pxxx Lxxx
Cxxx Mxxx
Cxxx Cxxx
Nxxx Cxxx
A combo box for users to pick enquiry type,
Complaint
Product Enquiry
Endorsement Enquiry
Claims Enquiry
Sales Enquiry
General Enquiry
The unique code should be generated when above fields are filled (or not empty you could call that)
e.g. E1710PL003651 and C1710NC003823
1st letter, C = Complaint, otherwise E = other enquires
17 = YY, extract year from date
10 = MM in digital, extract month from date
6th - 7th letter, the initial of handlers, i.e. PL or NC
the digital behind is just the current time in hhmmss format
If one of these fields are empty, label or text box could show "Not enough info to generate code"
All I could think of its to use if functions for each fields and generate a value
Then a label or textbox to show a combination of different values.
But I couldn't get the data to show on the label when the "handle by" is not empty and not sure how to set up values for each fields.
It would be great if any of you experts could advise or give me some ideas how to tackle such issue, thankyou all in advance!
Regards
Tom