Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default How to replace numbers in sequence without sorting?

Hi,

I need to replace those numbers duplicate so that it follow in
sequence for example:

In Column A I have these number
2,1,5,3,3,6,8,8 (Before)
2,1,5,3,4,6,8,9 (after)
Anyone got idea how to do it with macro?
Please.Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default How to replace numbers in sequence without sorting?

See if this suit your needs:

Sub SequenseFill()
Col = "A"
FirstRow = 1
LastRow = Cells(FirstRow, Col).End(xlDown).Row
For r = FirstRow + 1 To LastRow
If Cells(r - 1, Col) = Cells(r, Col) Then
Cells(r, Col) = Cells(r, Col) + 1
End If
Next
End Sub

Regards,
Per

On 20 Jul., 15:48, geniusideas wrote:
Hi,

I need to replace those numbers duplicate so that it follow in
sequence for example:

In Column A I have these number
2,1,5,3,3,6,8,8 (Before)
2,1,5,3,4,6,8,9 (after)
Anyone got idea how to do it with macro?
Please.Thanks


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
Replace one number in a sequence in a group of cells penquicw Excel Worksheet Functions 7 April 23rd 08 11:53 AM
replace dash in a number sequence Willy Wonka Excel Worksheet Functions 1 February 14th 08 12:04 AM
How to find & replace a formula sequence with * in it? creativeops Excel Discussion (Misc queries) 2 September 8th 06 05:17 PM
Sequence of numbers JohnUK Excel Programming 7 July 4th 06 02:25 PM
sequence of numbers andrewm Excel Worksheet Functions 3 November 13th 05 06:20 PM


All times are GMT +1. The time now is 10:35 PM.

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"