LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Macro for selecting random lines

Sorry to be such a nuisance but I am new at Excel macros and have been put
into a situation where I have to get some stuff up and running in a short
time. I was conscripted into a volunteer position and could sure use some
guidance.
I was given a file with a total of 635 lines of questions and a macro
(below) that is supposed to select 100 questions and answers (seperate
documents)

Sub RunRandom()
Range("A2:A635").Select
Selection.Copy
Range("B2").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveSheet.Paste
Application.CutCopyMode = False
Range("C1:C638").AdvancedFilter Action:=xlFilterInPlace, Unique:= _
True
Range("E2").Select
Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, Header:= _
xlYes, OrderCustom:=1, MatchCase:=False, Orientation:= _
xlTopToBottom
Range("D2").Select
ActiveCell.FormulaR1C1 = "1"
Range("D3").Select
ActiveCell.FormulaR1C1 = "2"
Range("D2:D3").Select
Selection.AutoFill Destination:=Range("D2:D638"), Type:= _
xlFillDefault
Range("D2:D151").Select
Range("A1").Select
End Sub

My understanding is that the questions are supposed to be printed on one
document and the answers on another.
I intend to buy a book so I don't have to rely on others but could really
use some help until I get a bit of an understanding.
Thanks sincerely
Bob


 
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
the formula for random selecting Inquiring mind Excel Discussion (Misc queries) 2 March 19th 09 02:33 PM
Need macro for copying random lines of data FeFi Excel Discussion (Misc queries) 3 March 13th 08 06:47 PM
Selecting Random Data myssieh Excel Worksheet Functions 5 February 13th 08 05:09 PM
Selecting Random Data Willie Excel Worksheet Functions 2 August 18th 05 06:26 PM
selecting random records terry freedman Excel Programming 2 April 2nd 04 11:07 AM


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