Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default automatically sequencing 06-2597 thru 06-2600

How do I automatic sequncing this numbers
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default automatically sequencing 06-2597 thru 06-2600


"
schreef in bericht
...
How do I automatic sequncing this numbers



In a module:

Public Function SEQUENCE(ByVal fromCell As String) As String
Dim nVal As Integer
nVal = CInt(Right(fromCell, 4))
While Right(nVal, 2) < "00"
nVal = nVal + 1
Wend
SEQUENCE = Left(fromCell, 3) & nVal
End Function


Or, if you want i.e. 06-2486 to be converted to 06-2400 because it's below
06-...500, then use this one.


Public Function SEQUENCE(ByVal fromCell As String) As String
Dim nVal As Integer
Dim i As Integer
nVal = CInt(Right(fromCell, 4))
i = 1
If Right(nVal, 3) < 500 Then i = -1
While Right(nVal, 2) < "00"
nVal = nVal + i
Wend
SEQUENCE = Left(fromCell, 3) & nVal
End Function

In your worksheet you can then use =SEQUENCE(A1)


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
Programmable Column Sequencing? G Excel Discussion (Misc queries) 2 May 27th 10 09:56 PM
automatic number sequencing? Joe the exceler Excel Worksheet Functions 1 January 7th 09 11:55 PM
Sequencing of projects Daniel Excel Discussion (Misc queries) 1 May 23rd 07 12:27 AM
Row Sequencing Mark Excel Worksheet Functions 8 August 18th 05 06:33 PM
Need a 1 Column multiplication formula for 2600 cells. How? Buckle Excel Worksheet Functions 1 March 25th 05 04:17 PM


All times are GMT +1. The time now is 09:11 PM.

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

About Us

"It's about Microsoft Excel"