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

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


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 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 07:11 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"