Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Remaining Numbers from a List that are not used

Say I have in the following cells

A1 134
A2 567
A3 368

I want C5 to show the remaining numbers from the list of
1,2,3,4,5,6,7,8,9
i.e. 2, 9

This required over approx 25 groups of cells in a sheet


Anyone done this before?

I am not good at VBA, but can manage most Excel functions happily

Lorence
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Remaining Numbers from a List that are not used

Lorence,

Try:
Sub Mytest()
Dim L As String, TestST As String
Dim X, Y
TestST = "123456789"
L = Range("A1").Text & Range("A2").Text & Range("A3").Text
For X = 1 To 9
Y = 1
Do

If Mid(L, X, 1) = Mid(TestST, Y, 1) Then _
TestST = Left(TestST, Y - 1) & Right(TestST, Len(TestST) - Y)
Y = Y + 1
Loop Until Y Len(TestST)
Next X
Range("C5").Value = TestST
End Sub


Henry


"Lorence" wrote in message
...
Say I have in the following cells

A1 134
A2 567
A3 368

I want C5 to show the remaining numbers from the list of
1,2,3,4,5,6,7,8,9
i.e. 2, 9

This required over approx 25 groups of cells in a sheet


Anyone done this before?

I am not good at VBA, but can manage most Excel functions happily

Lorence



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Remaining Numbers from a List that are not used

On Tue, 14 Jun 2005 00:35:56 GMT, "Henry"
wrote:

Lorence,

Try:
Sub Mytest()
Dim L As String, TestST As String
Dim X, Y
TestST = "123456789"
L = Range("A1").Text & Range("A2").Text & Range("A3").Text
For X = 1 To 9
Y = 1
Do

If Mid(L, X, 1) = Mid(TestST, Y, 1) Then _
TestST = Left(TestST, Y - 1) & Right(TestST, Len(TestST) - Y)
Y = Y + 1
Loop Until Y Len(TestST)
Next X
Range("C5").Value = TestST
End Sub


Henry


Works brilliantly - thks

Lorence
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
How can I extract a list of numbers missing in a list? Nancy New Users to Excel 2 January 28th 10 11:18 PM
add multiple numbers in one cell with those numbers remaining visi TD Excel Worksheet Functions 7 May 28th 09 09:41 PM
change a vertical list of numbers to horizontal list from 1 cell caz Excel Discussion (Misc queries) 3 September 27th 06 12:11 PM
how to extract unique numbers once from a list of repeated numbers? [email protected] Excel Discussion (Misc queries) 2 May 2nd 06 04:17 PM
One Selection From Drop Down List Limits Remaining Selections JB2010 Excel Discussion (Misc queries) 2 March 7th 06 12:45 PM


All times are GMT +1. The time now is 05:55 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"