LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default selected numbers to disappear

Hope I can express myself:
Say we have numbers 1...35 on column C1:C35. When we select a random number
(say 15) via our macro, the cell containing that number (C15) is cleared.
Now I wonder if we can move the rest of the remaining number list on column
C1:C35 upwards so that the "cleared" cells are pushed towards the bottom of
column C.
TIA



"Bob Phillips" wrote in message
...
Pardon, I do not understand.

Fill what cells, with what?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Martyn Wilson" wrote in message
...
Hi, an follow-up addy...:)
Is it possible to fill in the remaining cells as we move along clearing

the
drawn list numbers on column C1:C35 ?
Martyn

"Bob Phillips" wrote in message
...
Sub Rast()
Dim say As Integer
Dim ara As Range
Dim RS As Integer
Dim oCell As Range

say = WorksheetFunction.CountA(Range("B1:B35")) + 1
If say = 36 Then Exit Sub

Randomize
again:
RS = Int((Rnd * 35) + 1)
For Each ara In Range("B1:B" & say)
If ara.Value = RS Then
GoTo again
End If
Next ara
If RS = 1 Then
Debug.Print RS
End If
Range("A1") = RS
Cells(say, 2) = RS
Set oCell = Columns(3).Find(RS, lookat:=xlWhole)
If Not oCell Is Nothing Then oCell.ClearContents
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Martyn Wilson" wrote in message
...
Hi,
The below code is for drawing random numbers between 1-35 (not

repeating).
The drawn number is being displayed in A1 and at the same time

beeing
added
on column B1:B35 as the macro is executed repetedly via a control

button.
So
far so good. But I need to add a new dimension to this code:
I am also displaying the numbers 1...35 on column C1:C35 and as I go

along
selecting random numbers via the macro, I want the drawn number on

column
C
to disappear one after the other as well...How is this achieved?
TIA
----------------------
Sub Rast()
Dim say As Integer
Dim ara As Range
Dim RS As Integer

say = WorksheetFunction.CountA(Range("B1:B35")) + 1
If say = 36 Then Exit Sub

Randomize
again:
RS = Int((Rnd * 35) + 1)
For Each ara In Range("B1:B" & say)
If ara.Value = RS Then
GoTo again
End If
Next ara
Range("A1") = RS
Cells(say, 2) = RS
End Sub
----------------------------------------


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.714 / Virus Database: 470 - Release Date: 02.07.2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.715 / Virus Database: 471 - Release Date: 04.07.2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.715 / Virus Database: 471 - Release Date: 04.07.2004




 
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 to add 130% to a selected range of numbers ? MATHIMATICALLY IMPAIRED Excel Discussion (Misc queries) 4 January 14th 09 05:22 PM
Move selected Text/Numbers from Col D to Col A/B pattlee Excel Discussion (Misc queries) 17 July 8th 08 07:58 PM
Inserting Text Makes Numbers Disappear! al Excel Discussion (Misc queries) 5 January 5th 08 02:38 PM
add page numbers to selected sheets SLA Excel Worksheet Functions 1 August 24th 07 12:48 AM
Add selected numbers in a column that are a different color Sam Excel Discussion (Misc queries) 6 March 4th 05 11:46 PM


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