User Friendly Code for Admission No
Solved/Closed
smuneeb
Posts
67
Registration date
Saturday September 5, 2015
Status
Member
Last seen
March 8, 2017
-
Jan 18, 2016 at 08:22 AM
smuneeb Posts 67 Registration date Saturday September 5, 2015 Status Member Last seen March 8, 2017 - Jan 26, 2016 at 10:33 PM
smuneeb Posts 67 Registration date Saturday September 5, 2015 Status Member Last seen March 8, 2017 - Jan 26, 2016 at 10:33 PM
Related:
- User Friendly Code for Admission No
- Battery reset code - Guide
- Cs 1.6 friendly fire command - Guide
- Samsung volume increase code - Guide
- Usa country code for whatsapp - Guide
- How to get whatsapp verification code online - Guide
3 responses
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Jan 19, 2016 at 11:49 AM
Jan 19, 2016 at 11:49 AM
Isn't this the same question as this?:
https://ccm.net/forum/affich-861038-difficult-query#p861975
https://ccm.net/forum/affich-861038-difficult-query#p861975
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Jan 26, 2016 at 12:00 PM
Jan 26, 2016 at 12:00 PM
Hi Smuneeb,
Good to see you find this user friendly.
How about this code:
Best regards,
Trowa
Good to see you find this user friendly.
How about this code:
Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("B11:B510")) Is Nothing Then Exit Sub If Target.Value = vbNullString Then Exit Sub If InStr(1, Target.Value, "-") = 2 And Len(Target.Value) >= 9 And Len(Target.Value) <= 11 Then If StrComp(Left(Target.Value, 1), UCase(Left(Target.Value, 1)), vbBinaryCompare) = 0 Then Exit Sub Target = UCase(Target.Value) Exit Sub ElseIf InStr(1, Target.Value, "-") <> 2 And Len(Target.Value) >= 8 And Len(Target.Value) <= 10 Then Target = UCase(Left(Target.Value, 1)) & "-" & Right(Target.Value, Len(Target.Value) - 1) Else Target.Value = vbNullString MsgBox "This is not a valid entry." End If End Sub
Best regards,
Trowa
smuneeb
Posts
67
Registration date
Saturday September 5, 2015
Status
Member
Last seen
March 8, 2017
1
Jan 26, 2016 at 10:33 PM
Jan 26, 2016 at 10:33 PM
Hi Trowa
You are great thanks for cooperation and excellent job
Best Regards
Muneeb
You are great thanks for cooperation and excellent job
Best Regards
Muneeb
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Jan 21, 2016 at 11:41 AM
Jan 21, 2016 at 11:41 AM
Hi Smuneeb,
Then why didn't you let me know in the other post?
You can try the following code:
Best regards,
Trowa
Then why didn't you let me know in the other post?
You can try the following code:
Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("B11:B510")) Is Nothing Then Exit Sub If InStr(1, Target.Value, "-") = 2 Then If StrComp(strFirst, UCase(strFirst), vbBinaryCompare) = 0 Then Exit Sub Target = UCase(Target.Value) Exit Sub Else Target = UCase(Left(Target.Value, 1)) & "-" & Right(Target.Value, Len(Target.Value) - 1) End If End Sub
Best regards,
Trowa
smuneeb
Posts
67
Registration date
Saturday September 5, 2015
Status
Member
Last seen
March 8, 2017
1
Jan 23, 2016 at 03:17 PM
Jan 23, 2016 at 03:17 PM
Hi Trowa
Your code is user friendly but please make one more addition as per my request in posted query that after hyphen symbol if the length of numeric character length (not alpha character length i.e. no alpha character is applied after hyphen symbol) is between 7 and 9 then it changes to requirement else it shows an error message.
Thanks
Your code is user friendly but please make one more addition as per my request in posted query that after hyphen symbol if the length of numeric character length (not alpha character length i.e. no alpha character is applied after hyphen symbol) is between 7 and 9 then it changes to requirement else it shows an error message.
Thanks
Jan 20, 2016 at 07:29 AM
It is similar but the solution is not user friendly its a formula, and its not valuable when user is enter in B column where range is fixed B11 to B 510.
I am not demotivating your solution, you create it with your concept which is appreciable.
Thanks