Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Code for Case & Number format

Please help !
I have 34 users & I need to assign for each user a separate no. in cel
A2. The format of the number need to be with 2 letters assigned t
individual & leading with 0 (zero) if the number is below 100 (e.g., i
cell A2 is entered with 22, its value to be ar022 & not ar22) else wit
the no.(say, ar122).
Secondly, the writing of code will be very big if I have to write fo
34 cases. How do I make it simple?

Select Case Application.UserName
Case "X1"
If Range("A2").Value < 100 Then
Range("A2").NumberFormat = """ar0""0"
Else: Range("A2").NumberFormat="""ar""0"
End If
Case "X2"
If Range("A2").Value < 100 Then
Range("A2").NumberFormat = """br0""0"
Else: Range("A2").NumberFormat="""br""0"
End If
Case "X3"
If Range("A2").Value < 100 Then
Range("A2").NumberFormat = """cr0""0"
Else: Range("A2").NumberFormat="""cr""0"
End If
Case n....

End Selec

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Code for Case & Number format

you need to explain the incrementing better. i understand the 100 part, but what about the x1:ar, x2:ab, x3:ac ...since there are only 26 letters in the alphabet ... whats the deal with that? Then you get help with your code. Choose clarity over being succinct.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
custom number format code using letters and numbers Foo Foo Daddy Excel Worksheet Functions 15 December 26th 16 12:33 PM
Number Format Code won't work tbmarlie Excel Discussion (Misc queries) 2 October 15th 07 06:46 PM
Format Case for only Deepak Excel Discussion (Misc queries) 1 November 25th 06 10:38 AM
Format the Cell into a telephone number but using country code Chris Quinn Excel Discussion (Misc queries) 1 January 27th 05 03:51 PM
Proper case code not working right Juan Excel Programming 3 April 16th 04 11:11 PM


All times are GMT +1. The time now is 12:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"