Free Microsoft Excel 2013 Quick Reference

Randomly select numbers from a range Results

Hi,

I am trying to do a random sort and pull values from column A. The amount of data in that column will change each time I use this template spreadsheet.

When my loop does the pull it selects a couple of empty cells past the last cell of data. How do I correct that? Is it my iRange? Below is my code:

 
Sub ProjectSelect()
'
' ProjectSelect Macro
' This randomly selects projects using a 95% confidence level
'

    Range("A19:A1000").Select
    Selection.NumberFormat = "0"
    Range("A4").Select
    ActiveCell.FormulaR1C1 = "=COUNT(R[15]C:R[996]C)"
    Range("A5").Select
    ActiveCell.FormulaR1C1 = "=R[-1]C/(1+R[-1]C*0.05*0.05)"
    Range("A5").Select
    Selection.NumberFormat = "0"
    Range("A19:A1000").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    
Dim iCount As Long
Dim i As Long
Dim iOffset As Long
Dim iRange As Long
Dim bUnique As Boolean

iRange = Application.WorksheetFunction.Count(Range("A:A"))
iCount = InputBox("Enter the number of random values to pull")


Range("A19:A1000").Interior.ColorIndex = xlNone
Range("b19:b1000").ClearContents
For i = 1 To iCount

Do
iOffset = Rnd() * iRange
If Range("A19").Offset(iOffset, 0).Interior.ColorIndex = 6 Then
bUnique = False
Else
Range("A19").Offset(iOffset, 0).Interior.ColorIndex = 6
bUnique = True
Range("b19").Offset(i, 0) = Range("A19").Offset(iOffset, 0)
End If
Loop Until bUnique = True


Next i
 Range("B19:B1000").Select
    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("B19:B1000") _
        , SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
    With ActiveWorkbook.Worksheets("Sheet1").Sort
        .SetRange Range("B19:B1000")
        .Header = xlGuess
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With

End Sub


I need a code that can randomly select a set of numbers each time the macro is ran.
I already recorded a macro but I did it to ramdon select from A-J in terms of roll and this selection should be from the already generated numbers I have in the sheet.

This what I have recorded
Sub copyWeigths_sheet2()
' copyWeigths_sheet2 Macro
Sheets("WEIGHTS").Select
Range("A9:J9").Select ' this could be A28 to J28
Selection.Copy
Sheets("Sheet2").Select
Range("V501:AE501").Select
ActiveSheet.Paste
End Sub
Thanks.

dominicb posted this as an example of generating unique random numbers from a defined range 1-90
so i thought i'd modify it fot use in a raffle
code was
Sub test()
Dim rand1(90)
Randomize
For n = 1 To 90
Check1:
rand1(n) = Int((90 * Rnd(100)) + 1)
For F = 1 To T
If rand1(n) = rand1(F) Then GoTo Check1:
Next F
T = T + 1
Next n
For n = 1 To 90
MsgBox rand1(n)
Next n
End Sub
so after a bit of playing i thought
if i changed this to
Sub test()
Dim rand1(1000)
Randomize
For n = 1 To 1000
Check1:
rand1(n) = Int((1000* Rnd(100)) + 1)
For F = 1 To T
If rand1(n) = rand1(F) Then GoTo Check1:
Next F
T = T + 1
Next n
For n = 1 To 1000
MsgBox rand1(n)
Next n
End Sub
i could use it for raffle tickets, it seems to work ok
but then i thought what if i only sell say tickets 200 to 599
and only those to be selected, this is where i cant figure it out. ideally i'd like to be able to put start and end numbers of range in say a2/b2.
and..................sorry.....a means of stopping it cleanly when all prizes given out. i know control brk works but is there another option?

Hello.

I have a table (9 columns, 500 rows) of 3-digit random numbers ranging from 001-999. Naturally, numbers are repeated - at random - throughout the table. I want Excel to generate a single-column list of unique numbers from the table according to the following parameters:

*User defines quantity of numbers to select.
*User defines the cell from which to begin number selection. (Or, Excel randomly selects a cell from which to begin number selection.)
*User defines a range of values that are acceptable for selection.
*Excel "reads" the table from left-to-right across the columns and from top-to-bottom down the rows, selecting non-repeating numbers from the table that fall with the user-defined range. If Excel finds a cell containing a number that has been previously selected or that is outside of the user-defined range, it skips to the next cell.

This can't be something too complicated to program, but clearly I don't know any appropriate code. I imagine that there might even be a pre-programmed function or macro to accomplish this. Can anyone shed some light on this for me?

Thanks.

Take a look at the attached workbook. Columns F, G, H contain the percentages which correspond to the options selected by the user in Columns C, D, ECells F4, G4, H4 contain the maximum value of these percentages.Columns A and B are conditionally formatted so that the option and percentage cells corresponding to this maximum percentage are highlighted.Pressing the F9 key recalculates the various random numbers on the worksheet, and the appropriate option and percentage cells are again highlighted
I need the "Chosen SPP" field to be locked in once data is added to the next column. For example, once the user has acheived a result in C5, that result will be locked into C5. The user will then move on to Column D, select their options and acheive a result in D5. That result will be lock into D5. The user will then move on to Column E... etc. etc.

Originally Posted by ConneXionLost The RAND() function will give you a new set of data every time the spreadsheet recalculates. As long as you're relying on the RAND() function as the source of your data, it will place the problem of "locking in" the selected values well beyond the capabilities of any LOOKUP formula or conditional format solution. Especially if you intend to do this with multiple examples.

I recommend you begin a new thread with the suggested title of: "VBA method of copying values from RAND() to a range based on values in another range".

Hopefully one of the VBA experts here can help you.

Good luck,

Hello, I found the below code from a user here and it works great, except that it does not preserve the formatting of the items in the list. The items have various font colors and/or backgrounds and when it does the random sorting, it changes both attributes and assigns them to other items. Is there a way to do this and preserve the formatting?

Thank you very much.


	VB:
	
 1 
Sub RandomSort() 
     
    Dim rnum 
    Dim arr() 
    Dim i As Long 
    Dim x As Long 
    Dim col As Long 
    Dim nrow As Long 
    Dim srow As Long 
    Dim countt As Long 
     
     'check one col and more than 1 row
    If Selection.Rows.Count = 1 Or Selection.Columns.Count > 1 Then Exit Sub 
     
     'turn off screen for speed
    Application.ScreenUpdating = False 
     
     'get start row number
    srow = Selection.Rows.Row 
     
     'get current col #
    col = Selection.Column 
     
     'get number of rows
    countt = Selection.Rows.Count 
     
     'sort
    Selection.Sort Key1:=Cells(srow, col), Order1:=xlAscending, Header:=xlGuess, _ 
    OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom 
     
     'eliminate blanks
    Range(Cells(srow, col), Cells(srow, col).End(xlDown)).Select 
     
     'check number of rows remaining
    If Selection.Rows.Count < countt Then 
         'was blanks, reset count
        countt = Selection.Rows.Count 
    End If 
     
     'set array length
    Redim arr(countt) 
     
     'arr index
    x = 1 
     
     'row index
    nrow = srow 
     
     'load array with values
    For i = 1 To countt 
        arr(x) = Cells(nrow, col) 
        x = x + 1 
        nrow = nrow + 1 
    Next i 
     
     'reset i
    i = 1 
    nrow = srow 
     
     'repopulate selection 'randomly'
    Do Until i = countt + 1 
        rnum = Int((countt - 1 + 1) * Rnd + 1) 
        If arr(rnum)  "" Then 
            Cells(nrow, col) = arr(rnum) 
            arr(rnum) = "" 
            i = i + 1 
            nrow = nrow + 1 
        End If 
    Loop 
     
    Cells(srow, col).Select 
     
     'turn on screen
    Application.ScreenUpdating = True 
     
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines


I posted http://www.ozgrid.com/forum/showthread.php?t=143791 yesterday but received no responses so I have decided to approach the problem from a different angle. (please delete old post)

I would like to build a VBA query that will automatically submit a series of search terms (names) from column A, Sheet 1 in Excel to a website (http://www.consumerbeware.mgs.gov.on...arch/search.do) and copy the search results back to excel on Sheet 2.

On the website the type of search must first be selected from a drop down control labelled "Licence/Registration/Appointment Type" (or 'searchType"). The type of search to be selected is "Bailiff / Assistant Bailiff"

Of the 5 available search fields (File#,Name,Address,City,Postal), only Name will be used. The names stored in column A of the spreadsheet will submitted one after another and the results copied one after the next on Sheet 2. Note the number of results received can be 0 to 100 rows in length and I want to copy them all.

I believe the search results can be copied 'as is' in that they parse properly when pasting into excel. I suggest searching on a random first name to see what I mean. The data comes up in a nice selectable table but on a new page meaning you have to click on New Search or the back button to perform the next search eact time.

I tried modifying a number of other posts, the closest was from someone trying to search on a series of stock tickers but I could not get it to work. Here it is;

	VB:
	
 '
Dim QT As QueryTable 
Dim strConnectString 
Dim sTxt As String 
 
For m = 1 To 357 
     
    sTxt = Cells(m, "A").Value 
     
    strConnectString = "URL;http://uk.finance.yahoo.com/q/hp?s=" & sTxt & "&b=21&a=04&c=2009&e=21&d=05&f=2009&g=d" 
     ' On the Workspace worksheet, clear all existing query tables
    For Each QT In ActiveSheet.QueryTables 
        QT.Delete 
    Next QT 
     
    Columns("B:H").Select 
    Selection.ClearContents 
     'Range("B1").Select
     
     ' Define a new Web Query
    Set QT = ActiveSheet.QueryTables.Add(Connection:=strConnectString, Destination:=Range("B1")) 
    With QT 
        .Name = sTxt 
        .FieldNames = True 
        .RowNumbers = False 
        .FillAdjacentFormulas = False 
        .PreserveFormatting = True 
        .RefreshOnFileOpen = False 
        .BackgroundQuery = False 
        .RefreshStyle = xlInsertDeleteCells 
        .SavePassword = False 
        .SaveData = True 
        .AdjustColumnWidth = True 
        .RefreshPeriod = 0 
        .WebSelectionType = xlSpecifiedTables 
        .WebFormatting = xlWebFormattingNone 
        .WebTables = "21" 
        .WebPreFormattedTextToColumns = True 
        .WebConsecutiveDelimitersAsOne = True 
        .WebSingleBlockTextImport = False 
        .WebDisableDateRecognition = False 
        .WebDisableRedirections = False 
    End With 
     
     ' Refresh the Query
    QT.Refresh BackgroundQuery:=False 
     
     
    Range("j" & m).Select 
    Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ 
    False, Transpose:=True 
    Range("B1").Select 
     
Next m 
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines


Afternoon all,

I have been using this code to extract data from txt files


	VB:
	
 
Sub DelRows() 
     'File 1
     'Import Comma delimited txt
    Workbooks.OpenText Filename:= _ 
    "V:HQNDSGroupsFleet DataRoad FleetSuppliersAllStar Business Solutions Limited (Fuel Accounts)PaymentsFuelImport1.txt" _ 
    , Origin:=xlMSDOS, _ 
    StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _ 
    ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False, Comma:=True _ 
    , Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1), _ 
    Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), Array(9, 1), _ 
    Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15, 1), Array( _ 
    16, 1), Array(17, 1), Array(18, 1), Array(19, 1), Array(20, 1), Array(21, 1), Array(22, 1), _ 
    Array(23, 1), Array(24, 1), Array(25, 1), Array(26, 1), Array(27, 1), Array(28, 1), Array( _ 
    29, 1), Array(30, 1), Array(31, 1)), TrailingMinusNumbers:=True 
     
     'Sort AZ
     
    Cells.Select 
    Range("A1").Activate 
    Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _ 
    OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ 
    DataOption1:=xlSortNormal 
     'Delete Rows based on Column A being an 8 digit number
    Lstrow = Range("A65536").End(xlUp).Row 
     
    For x = Lstrow To 2 Step -1 
         
        If Len(Cells(x, 2)) > 8 Or Len(Cells(x, 1)) > 8 Then 
            Rows(x).EntireRow.Delete 
             
        End If 
    Next x 
     
     
     
     'Insert new column A copy and paste AE into A and Format E to number
     
    Columns("A:A").Select 
    Selection.Insert Shift:=xlToRight 
    Columns("AE:AE").Select 
    Selection.Cut 
    Columns("A:A").Select 
    ActiveSheet.Paste 
    Columns("E:E").Select 
    Selection.NumberFormat = "0" 
    Rows("1:1").Select 
    Selection.Insert Shift:=xlDown 
     
     'Copy headers in from new sheet
     
    ChDir _ 
    "V:HQNDSGroupsFleet DataRoad FleetSuppliersAllStar Business Solutions Limited (Fuel Accounts)Payments" 
    Workbooks.Open Filename:= _ 
    "V:HQNDSGroupsFleet DataRoad FleetSuppliersAllStar Business Solutions Limited (Fuel Accounts)PaymentsArval Finance column
headings.xls" _ 
    , Origin:=xlWindows 
    Rows("1:1").Select 
    Selection.Copy 
    Windows("FuelImport1.txt").Activate 
    ActiveSheet.Paste 
     
     'Resize column and row
     
    Cells.EntireColumn.AutoFit 
    Cells.EntireRow.AutoFit 
     
     'Name sheet Tab
     
    ActiveSheet.Name = [B2] & "_" & Format([F2], "yyyyddmm") 
     
     'File 2
     'Import Comma delimited txt
    Workbooks.OpenText Filename:= _ 
    "V:HQNDSGroupsFleet DataRoad FleetSuppliersAllStar Business Solutions Limited (Fuel Accounts)PaymentsFuelImport2.txt" _ 
    , Origin:=xlMSDOS, _ 
    StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _ 
    ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False, Comma:=True _ 
    , Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1), _ 
    Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), Array(9, 1), _ 
    Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15, 1), Array( _ 
    16, 1), Array(17, 1), Array(18, 1), Array(19, 1), Array(20, 1), Array(21, 1), Array(22, 1), _ 
    Array(23, 1), Array(24, 1), Array(25, 1), Array(26, 1), Array(27, 1), Array(28, 1), Array( _ 
    29, 1), Array(30, 1), Array(31, 1)), TrailingMinusNumbers:=True 
     
     'Sort AZ
     
    Cells.Select 
    Range("A1").Activate 
    Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _ 
    OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ 
    DataOption1:=xlSortNormal 
     'Delete Rows based on Column A being an 8 digit number
    Lstrow = Range("A65536").End(xlUp).Row 
     
    For x = Lstrow To 2 Step -1 
         
        If Len(Cells(x, 2)) > 8 Or Len(Cells(x, 1)) > 8 Then 
            Rows(x).EntireRow.Delete 
             
        End If 
    Next x 
     
     
     'Insert new column A copy and paste AE into A and Format E to number
     
    Columns("A:A").Select 
    Selection.Insert Shift:=xlToRight 
    Columns("AE:AE").Select 
    Selection.Cut 
    Columns("A:A").Select 
    ActiveSheet.Paste 
    Columns("E:E").Select 
    Selection.NumberFormat = "0" 
    Rows("1:1").Select 
    Selection.Insert Shift:=xlDown 
     
     'Copy headers in from new sheet
     
    Windows("Arval Finance column headings.xls").Activate 
    Rows("1:1").Select 
    Selection.Copy 
    Windows("FuelImport5.txt").Activate 
    ActiveSheet.Paste 
     
     'Resize column and row
     
    Cells.EntireColumn.AutoFit 
    Cells.EntireRow.AutoFit 
     
     'Name sheet Tab
     
    ActiveSheet.Name = [B2] & "_" & Format([F2], "yyyyddmm") 
     
    Workbooks("Arval Finance column headings.xls").Close SaveChanges:=False 
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
The problem is that the dates going into column F are being formatted from GENERAL to DATE format and when this happens it turns the cell from DDMMYYYY to MMDDYYYY. This wouldn't be a problem if it did it for the entire column but it only does it for random cells.

Any ideas why this is happening?

Stu

Good evening,

I am trying to write a program that outputs 5 random numbers without repetition from 50 numbers.
The number of combinations to be produced is in worksheet "Random Numbers" and in cell "P3".
The code below works as far as the above is concerned.


	VB:
	
 Random_Numbers_Generator() 
    Dim nDrawnMain As Long 
    Dim nFromMain As Long 
    Dim nDrawnLucky As Long 
    Dim nFromLucky As Long 
    Dim nComb As Long 
    Dim myMain() As Variant 
    Dim myLucky() As Variant 
     
    Application.ScreenUpdating = False 
    Application.Calculation = xlCalculationManual 
    Application.DisplayAlerts = False 
     
    nDrawnMain = 5 ' This is the number of random numbers to be drawn from 50
    nFromMain = 50 ' This is the 50 numbers to be drawn from
    nDrawnLucky = 2 ' This is the number of random numbers to be drawn from 9
    nFromLucky = 9 ' This is the 9 numbers to be drawn from
     
    Worksheets("Random Numbers").Select 
     
    With Worksheets("Random Numbers") 
        .Columns("A:J").ClearContents 
        Redim myMain(1 To nFromMain) ' This is the 50 numbers to be drawn from
        Redim myLucky(1 To nFromLucky) ' This is the 9 numbers to be drawn from.
        nComb = .Range("P3").Value ' This is the number of combinations to be produced.
    End With 
     
    For j = 1 To nComb 
         
        For H = 1 To nFromMain 
            myMain(H) = H 
        Next H 
         
        For k = 1 To nDrawnMain 
            Randomize 
NewNumber: 
            Number = Int(nFromMain * Rnd) + 1 
            If myMain(Number) = "" Then 
                Goto NewNumber 
            Else 
                Cells(j, k) = myMain(Number) 
                myMain(Number) = "" 
            End If 
        Next k 
    Next j 
     
    Range("N3").Select 
     
    Application.DisplayAlerts = True 
    Application.Calculation = xlCalculationAutomatic 
    Application.ScreenUpdating = True 
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
What I would like is to also output 2 random numbers without repetition from 9 numbers.
I would like to output these 2 random numbers from 9 after it has produced the 5 random numbers from 50 but with one blank cell in between the 5 random numbers and the 2 random numbers.
Both of these sets of random numbers are totally seperate from each other so could possibly have the same numbers in them.

I have already included the two variables for the 2 random numbers from 9 ...
nDrawnLucky = 2 ' This is the number of random numbers to be drawn from 9
nFromLucky = 9 ' This is the 9 numbers to be drawn from

So basically, the program will produce two sets of random numbers without repetition:-
The first set being 5 numbers from 50 numbers.
The second set being 2 numbers from 9 numbers.
The first set of 5 numbers for example will be output in cells A1:E1 and the second set of 2 numbers will be output in cells G1:H1.
These two sets of numbers will make one combination.
I would like the code to also look at the worksheet "Random Numbers" and the value in cell "P3".
The value in cell "P3" will be the number of combinations I would like it to produce underneath each other.
Thanks in advance,
Paul

I have worksheets that refernce values in one column off columns in others and do this on daily basis. each day there are blank amounts in random fields which I inturn use a macro to delete rows with blank amounts

I then want to autofill the numbers from 0001 to the bottem line of the sheet where the word "END" always is, as the position of the end word is random each time and autofill always needs a definite range how do I get my macro to autofill down to the word "end" ???

here is the code that doesnt work for me and I've been trying to fix


	VB:
	
 Macro1() 
    For counter = 1 To 30 
        Set curCell = Worksheets("Sheet1").Cells(counter, 6) 
        If curCell.Text = "END" Then Range(Cells(1, 6), Cells(counter-1, 6)). _ 
        Selection.DataSeries Rowcol:=xlColumns, Type:=xlAutoFill, Date:=xlDay, _ 
        Trend:=False 
    Next counter 
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
If anyone could please tell me what Im doing wrong I'd appreciate it, been trying to figure it out myself for 2 weeks now

In a range from D2:D50 there will be page numbers. They can be random (i.e. - 2, 3, 5, 10, 11, 12, 15, etc...). What I am trying to do is run a loop script on this column of numbers, once per number, until it reaches the end. Can someone please fill in the blanks for me on this one?

Do
Sheets("All Data").Select
Range("D2").Select
Selection.Copy
Sheets("All Trip Sheets").Select
Range("H2:I3").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Loop

I don't know how to do "Do..Loops". The basic function I'm trying to accomplish is to copy and paste the page number from "All Data" into the "All Trip Sheets" page, into merged cell H2:I3. It will then print that page and move to the next number in the list.

Any ideas?

Hello,

I have the following code,

checker3 is a random number from a specific forumla,

Sheets("SUMMARY").Cells(checker3, "A").Select
Selection.EntireRow.Delete

When I run these lines alone, it works fine, but when I ran it with my complete program, it returns "Run-time error '1004': Select method of Range class failed"

Any idea how i can fix this??

Thanks

OK ... I hope I can explain my problem here so that everyone can understand and hopefully provide some input.

I am running a macro. It applies a filter to my dataset. From the filtered data, it copies the contents of the first 20 cells, excluding the first header cell, of column G (range). Since this is a filtered list, row 1 (with the header is 1), but all the rows under it can be any random number based on the filter applied to the dataset. (eg row 337, 345, 467,... ,521)

Range("G337:G521").Select

These 20 cells are then pasted into the cells of another worksheet.

Now, since this is a macro, and the dataset is variable, when the filter is applied, it wants to always copy the range that the macro has recorded. I have this scenario happening in many of my macros where a range of cells are copied from a filtered list.

How do I ensure the first 20 cells are copied irregardless of the row numbers being as recorded in the macro?

Jenn

I haven't seen a solution like this on any posts...where you're randomizing a list based on an assigned count without blanks and without changing when refreshed. I'm interested to see what someone comes up with...

We get several sets of season tickets to various events to be distributed amongst several managers based on the mgr's headcount. So mgr1 may get 20 dates while mgr2 gets 5. All this info is calculated on Sheet1, but the only info that is important for this exercise are the mgr's names (B8:K8) and how many dates they get (B12:K12). Available Dates will always be the same as Total Headcount.

Short of writing names on sheets of paper and drawing them from a hat, I would like to automate this process w/ a push of a button.

Sheet1 - this is where the managers are listed and their Headcount is calculated. For example...

*********A*******B*****C
08|---Mgr's Names:--Mgr1--Mgr2
12|-Dates Awarded:---20----5

Sheet2 - this is where my ticket information is listed and will change based on different events.

*****A***B****C****D
1|--Date--Row--Seat--Mgr
2|-1/1/08--H----1/4---Mgr1 (Mgr is Randomly selected x-number of times for each Mgr)
3|-1/1/08--H----1/4---Mgr2

Ideally I would like to place a button on Sheet1 or 2 that would execute a code that looks at the range of Mgr's names and based on their hdct, inserts their name so many times in column D of Sheet2 like the above example. So if Mgr2 is only suppose to receive 5 dates, then the code/formula needs to randomize his name throughout the list on Sheet2 plus make sure his name isn't distributed no more than 5 times.

This information should not change once it's assigned or unless the button is pushed again. The number of Mgr's names in the row on Sheet1 will change, but is never be more than 15, so the code must skip over cells that are blank if referencing, for ex. B11:P11.

Thanks!

Assume I have a range of numbers from A1 to say D6, and the numbers are completely random (i.e. neither ascending nor descending).

If I then have a reference number in A10, I want to find out where (row and column number) in the range this reference value lies.

HOW CAN I DO THIS? I've tried MATCH, INDEX and LOOKUPS but the requirement for ascending/descending order in the range is foxing me out.

NOTE: The reference number may not be exactly the same as that in the range, but I want to select the location that has the next largest value over the reference.

So for example my reference may have a value of 1323.3, and the closest values in the range are maybe 1320 and 1340, I want to get the location of the cell that has the 1340 value.

Concerned that the thread was bypassed after going 4 deep, I have reposted
it with full includes.

The way the macro works as currently written, it can return to multiple
cells; but in this instance, I just need it to return either the sum of 2
randomly generated numbers between 1 and 6 (simulating a dice roll), or a
single randomly generated number between 1 and 6, and then have the cell be
stable after that is done (not constantly recalculating with every chnage
made to the spreadsheet).

"Bob Phillips" > wrote in message
...
> That cannot be a UDF as you are trying to write to many cells, a UDF only
> returns a result.
>
> --
> HTH
>
> Bob Phillips
>
> (remove nothere from email address if mailing direct)
>
> "Adam Kroger @hotmail.com>" . ..
>> what would I need to change to allow that UDF to be used in any cell?
>>
>> This is what I want to run:
>>
>> Sub ROll2D6()
>> Dim myCell As Range
>> Dim Sides As Integer
>> Dim Dies As Integer
>> Dim i As Integer
>> Dim myTemp As Integer
>>
>> Sides = 6
>> Dies = 2
>> For Each myCell In Selection
>> Randomize
>> myTemp = 0
>> For i = 1 To Dies
>> myTemp = myTemp + Application.RoundUp(Rnd() * Sides, 0)
>> Next i
>> myCell.Value = myTemp
>> Next myCell
>> End Sub
>>
>>
>> "Paul B" > wrote in message
>> ...
>> > Adam, not with a formula, but you can use a worksheet change event like
>> > this, put in sheet code
>> >
>> > Private Sub Worksheet_Change(ByVal Target As Range)
>> > If Target.Count > 1 Then Exit Sub
>> > If Target.Address = "$A$1" And UCase(Target.Value) = "Y" Then
>> > 'put your code here
>> > End If
>> > End Sub
>> >
>> >
>> > --
>> > Paul B
>> > Always backup your data before trying something new
>> > Please post any response to the newsgroups so others can benefit from
>> > it
>> > Feedback on answers is always appreciated!
>> > Using Excel 2002 & 2003
>> >
>> > "Adam Kroger @hotmail.com>" > > . ..
>> >> Can you execute a macro from inside a formula?
>> > IF(A1="Y",execute.macro,"")
>> >>
>> >> Thanks
>> >>
>> >>
>> >
>> >
>>
>>
>
>

I actually have two problems related to graph ranges:

1) I have a 6-column text file, each column separated by tabs (t) and
each row separated by newlines (n). However, each column does not
have the same number of entries. When a column has less entries than
the longest column of the 6, no data is present, just the "t" to move
on to the next column. I then select this entire 6-column text file
and paste it into Excel. The cells line up perfectly, and the data
looks correct. The trouble I am having is when I select an entire
column by clicking the top of it to create an area graph, the range of
the graph is always from 1 to the number of entries in the longest
column. It appears as though the "t" with no data before it is being
read (incorrectly) as a 0. I need the graph to range from 1 to the
number of entries in the column selected. Is there a way to fix this?

2) I will eventually have many of these 6-column text files. Not only
are the columns of differing lengths within each text-file, but the
columns will have differing lengths across different text files (i.e.,
just assume that any column from any text file is a random length). I
created a workbook that had 6 area charts based on the columns 1-6 of
one of these text files. I was hoping that I could just replace the
data with data from another text file, and the 6 area charts would
automatically update. Well, they half-way do. The data in the charts
update, but the ranges do not. The ranges continue to be the ranges
that were from the first text file used to initially create the
charts. Is there a way to fix this? I really don't want to (or think I
should have to) create 6 new charts for every text file.

Thanks for any help you can provide.

Sub MakeQuestions() & Sub CopyRangeFromMultiWorksheets() are the two macros
that I pasted below. For some reason when I have Sub
CopyRangeFromMultiWorksheets() in my workbook Sub MakeQuestions() doesn't
work but as soon as I remove Sub CopyRangeFromMultiWorksheets() from my
workbook Sub MakeQuestions() starts working again. Sub
CopyRangeFromMultiWorksheets(), on the other hand, works regardless of
whether Sub MakeQuestions() is in the workbook or not.

When I have both Sub MakeQuestions() & Sub CopyRangeFromMultiWorksheets()
in my workbook and I try to run Sub MakeQuestions() I get a visual basic help
box with a message that reads Compile error: Argument not optional. Then the
LastRow = part of this part of the code LastRow = .Range("E" &
Rows.Count).End(xlUp).Row ....gets highlighted in blue.

Do you know how I might be able to fix this? Both macros are below.

Sub MakeQuestions()

Dim SortArray(Questions, 2)

With Sheets(StatSht)
LastRow = .Range("E" & Rows.Count).End(xlUp).Row
RowCount = LastRow + 1
End With

'Randomly choose 12 , 16, 24
Quest = Int(3 * Rnd())
Select Case Quest
Case 0: NumberofTests = 12
Case 1: NumberofTests = 16
Case 2: NumberofTests = 24
End Select

For TestNumber = 1 To NumberofTests

'create numbers questions
For I = 1 To Questions
SortArray(I, 1) = I
SortArray(I, 2) = Rnd()
Next I

Sheets(StatSht).Range("B" & RowCount) = Questions

'sort array to get random question
For I = 1 To Questions
For j = I To Questions
If SortArray(j, 2) < SortArray(I, 2) Then
Temp = SortArray(I, 1)
SortArray(I, 1) = SortArray(j, 1)
SortArray(j, 1) = Temp

Temp = SortArray(I, 2)
SortArray(I, 2) = SortArray(j, 2)
SortArray(j, 2) = Temp

End If
Next j
With Sheets(StatSht)
'Save numbers in worksheet
.Range("E" & RowCount).Offset(0, I - 1) = _
SortArray(I, 1)
End With
Next I
RowCount = RowCount + 1
Next TestNumber
MsgBox "Click Begin Sentence Completion"
End Sub

Sub CopyRangeFromMultiWorksheets()
Dim sh As Worksheet
Dim DestSh As Worksheet
Dim Last As Long
Dim CopyRng As Range

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

'Delete the sheet "RDBMergeSheet" if it exist
Application.DisplayAlerts = False
On Error Resume Next
ActiveWorkbook.Worksheets("RDBMergeSheet").Delete
On Error GoTo 0
Application.DisplayAlerts = True

'Add a worksheet with the name "RDBMergeSheet"
Set DestSh = ActiveWorkbook.Worksheets.Add
DestSh.Name = "Summary Report"

'loop through all worksheets and copy the data to the DestSh
For Each sh In ActiveWorkbook.Worksheets
If IsError(Application.Match(sh.Name, _
Array(DestSh.Name, "Questions", "Status"), 0)) Then

'Find the last row with data on the DestSh
Last = LastRow(DestSh)

'Fill in the range that you want to copy
Set CopyRng = sh.Range("A1:B24")

'Test if there enough rows in the DestSh to copy all the data
If Last + CopyRng.Rows.Count > DestSh.Rows.Count Then
MsgBox "There are not enough rows in the Destsh"
GoTo ExitTheSub
End If

'This example copies values/formats, if you only want to copy the
'values or want to copy everything look at the example below
this macro
CopyRng.Copy
With DestSh.Cells(Last + 1, "A")
.PasteSpecial xlPasteValues
.PasteSpecial xlPasteFormats
Application.CutCopyMode = False
End With

'Optional: This will copy the sheet name in the H column
DestSh.Cells(Last + 1, "H").Resize(CopyRng.Rows.Count).Value =
sh.Name

End If
Next

ExitTheSub:

Application.Goto DestSh.Cells(1)

'AutoFit the column width in the DestSh sheet
DestSh.Columns.AutoFit

With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub

Function LastRow(sh As Worksheet)
On Error Resume Next
LastRow = sh.Cells.Find(What:="*", _
After:=sh.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
On Error GoTo 0
End Function

Function LastCol(sh As Worksheet)
On Error Resume Next
LastCol = sh.Cells.Find(What:="*", _
After:=sh.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Column
On Error GoTo 0
End Function

This is directed primarily to Harlan Grove because he provided the
original formula a bit more than 5 years ago (and I see he's still
here), but I guess anybody can feel free to jump right in. Harlan's
original post is appended below at the end of my new request.

This a little long and for that I apologize. I just want to be sure
that I'm as clear as I can be to anyone who reads this.

The formula I need help with is one I've used for more than 5 years. It
randomly pairs two golfers **after** the scores are turned in and
posted. We call that a blind draw, but in this case it's done after
play rather than before.

Until now, the worksheet in question has consisted of 4 columns of 36
rows. I need to expand it to 4 columns of 48 rows and therein lies my
problem. For reasons I do not understand, the formulas in Cols C and D
simply will not copy into additional rows. They seem to be
self-limiting to 36 rows.

Here's the criteria: Col A (A1:A48) is merely a line number, 1 through
48.

Col B (B1:B48) contains this formula " =Rand()"

Col C contains this formula:
=IF(ROW()-ROW(TopLeft)
Newsgroups: microsoft.public.excel.worksheet.functions
Sent: Monday, May 05, 2003 1058
Subject: Formula to Randomly Select Pairs

> "Terry" wrote...
> >I need help with a formula. More honestly, I need a formula --
> >because I have
> >no idea how to begin. I would like to have a formula which will
> >randomly pair
> >two people as partners. This is for a golf group, in case anyone's
> >interested. The list of names may vary from as low as 12 to as high
> >as 36 on
> >any given day. As each person joins the group, they are assigned a
> >number. I
> >could do this by hand by merely drawing numbers out of a hat, but I'd
> >like to
> >do it by formula using Excel, if possible. The only criterion I can
> >think of
> >is that no number be used more than once.
>
> This could be solved with a simple data structure and no circular
> recalculation.
> If there could be as many as 36 players but no more than this, name
> some 36-row,
> single column range Players. I'll use A1:A36 as an example. Enter
> player names
> in this range - don't fill in unneeded cells (so if you have, say, 20
> players,
> fill in A1:A20 and leave A21:A36 blank). Enter the formula =RAND() in
> each cell
> of another 36-row, single column range, and name that range Random.
> I'll use
> B1:B36 in this example, but this range doesn't need to be adjacent to
> the
> Players range. The random pairs would be generated in at most an
> 18-row,
> 2-column range. Name the top-left cell in that range TopLeft. I'll use
> D1:E18 as
> an example.
>
> Then enter the following formula in TopLeft (D1)
>
> =IF(ROW()-ROW(TopLeft) INDEX(Players,MATCH(LARGE(OFFSET(Random,0,0,COUNTA (Players),1),
> ROW()-ROW(TopLeft)+1),OFFSET(Random,0,0,COUNTA(Players), 1),0)),"")
>
> and the following formula in the cell immediately to its right (E1)
>
> =IF(ROW()-ROW(TopLeft) MATCH(SMALL(OFFSET(Random,0,0,COUNTA(Players),1),R OW()-ROW(TopLeft)+1),
> OFFSET(Random,0,0,COUNTA(Players),1),0)),"")
>
> Now select these two cells and fill them down into the next 17 rows,
> so in my
> example fill D1:E1 down into D2:E18.
>
> --

How to use Visual Basic for Applications (VBA) to change UserForms in Excel

How to Programmatically Manipulate a UserForm

How to Programmatically Create UserForms in Visual Basic for Applications

Download Attachment At Bottom For Live Links

The Hey, Scripting Guy! Archive: Microsoft Office

Microsoft Excel
• How Can I Import a Fixed-Width Data File into Microsoft Excel?
• How Can I Sort a Spreadsheet By Cell Color?
• How Can I Check the Value of a Specific Cell in a Bunch of Excel Spreadsheets?
• How Can I Mark the First Occurrence of a Number in an Excel Spreadsheet?
• How Can I Read Custom Summary Information Properties for an Excel File?
• How Can I Change the Color of a Spreadsheet Cell Based on a Range of Values?
• How Can I Import Multiple Worksheets into an Access Database?
• How Can I Search For Values in an Excel Worksheet?
• How Can I Cut a Row From One Excel Spreadsheet and Paste That Row Into Another Spreadsheet?
• How Can I Determine the Value of the Last Cell in an Excel Range?
• How Can I Convert an Excel Serial Number to a Date and Then Back?
• How Can I Insert New Rows Above the Last Row in an Excel Spreadsheet?
• How Can I Copy Data from Excel to PowerPoint?
• How Can I Retrieve Hyperlink Information From an Excel Spreadsheet?
• How Can I Insert Blank Rows (and Formulas) Into an Excel Worksheet?
• How Can I Update and Then Break All the Links in an Excel Spreadsheet?
• How Can I Open All the Excel Spreadsheets in a Folder and Run a Specified Macro Found in Each of Those Spreadsheets?
• How Can I List the Addresses in My Sent Items Folder in an Excel Spreadsheet?
• How Can I Add a Background Picture to an Excel Worksheet?
• How Can I Replace Numeric Values in an Excel Spreadsheet?
• How Can I Copy Data From One Spreadsheet to Another?
• How Can I Replace Text in an Excel Spreadsheet?
• How Can I Set the Print Area in an Excel Spreadsheet?
• How Can I Delete Specified Rows in an Excel Spreadsheet?
• How Can I Color Every Other Row in an Excel Spreadsheet?
• How Can I Copy Selected Columns From a CSV File to an Excel File?
• How Can I Change the Background Color of Spreadsheet Rows That Have a Date in a Specified Cell?
• How Can I Export an HTA Table to Excel?
• How Can I Delete All the Worksheets in a Spreadsheet Except for the First Worksheet?
• How Can I Assign a Background Color to Cells in a Spreadsheet and Then “Sum” Those Cells?
• How Can I Sort a Row in an Excel Spreadsheet?
• How Can I Remove the Password When Opening an Excel Spreadsheet?
• How Can I Import an Excel Spreadsheet Into an Access Database?
• How Can I Save a Table in an Access Database as a Spreadsheet?
• How Can I Use a Blank Row to Separate Data in an Excel Spreadsheet?
• How Can I Specify the Number of Decimal Places to Display in an Excel Spreadsheet?
• How Can I Configure Excel to Autosave Every 5 Minutes?
• How Can I Save an Excel Chart as a Picture?
• How Can I Change the Font Color in Excel If a Specified Condition is Met?
• How Can I Convert an Excel Spreadsheet to XML?
• How Can I Set the Default File Path in Excel to a User’s Home Directory?
• How Can I Compare a List of Names in One Excel Column to a List of Names in Another Column?
• How Can I Convert a Tilde-Delimited File to Microsoft Excel Format?
• How Can I Search Active Directory for User Names Stored in an Excel Spreadsheet?
• How Can I Add a Total Row to an Excel Spreadsheet?
• How Can I Create a Custom Date Format in Microsoft Excel?
• How Can I Keep the Screen From Updating While Running an Excel Script?
• How Can I Use Information in an Excel Spreadsheet to Rename a Set of Folders?
• How Can I Determine the Background Color of a Spreadsheet Cell?
• How Can I Make the First Character in a Cell Uppercase and All the Other Characters Lowercase?
• How Can I Copy a Worksheet to a New Spreadsheet?
• How Can I Use Windows PowerShell to Automate Microsoft Excel?
• How Can I Tell If a Specified Worksheet Exists in an Excel Workbook?
• How Can I Add a COUNTIF Formula to an Excel Spreadsheet?
• How Can I Copy All the Comments From an Excel Worksheet to a Word Document?
• How Can I Change All the Lowercase Letters in an Excel Worksheet to Uppercase Letters?
• How Can I Create a New Excel Spreadsheet at Midnight Each Night?
• How Can I Select a Column of Data in Excel and Then Paste that Data into a Text File?
• How Can I Convert a Number to a Date in Excel?
• How Can I Locate and Replace Information for a Specific Item in a Spreadsheet?
• How Can I Save an Excel Spreadsheet, and Then Save a Copy as HTML?
• How Can I Format an Excel Spreadsheet So It Retains Leading Zeroes?
• How Can I Determine the Last Row in an Excel Spreadsheet?
• How Can I Remove All the Formatting from an Excel Spreadsheet?
• How Can I Change the Footer in an Excel Spreadsheet?
• How Can I Add Additional Worksheets to an Excel Workbook?
• How Can I Sort Worksheets in a Workbook?
• How Can I Import a Fixed-Width File into Microsoft Excel?
• How Can I Add a Hyperlink to an Excel Spreadsheet?
• How Can I Build an Array from a Column of Data in Excel?
• How Can I Copy Column C of One Worksheet to Column A of a Second Worksheet?
• How Can I Center Text in an Excel Cell?
• How Can I Change the Background Color of a Cell Depending on the Date?
• How Can I Delete Data from a Spreadsheet Yet Keep All the Formatting?
• How Can I Open an Excel Workbook and Retrieve the Names of All the Worksheets?
• How Can I Tell if an Excel Workbook is Open and, If It Isn’t, Open It?
• How Can I Insert a Column into a Spreadsheet?
• How Can I Save a Single Excel Worksheet to a CSV File?
• How Can I Password-Protect an Excel Spreadsheet?
• How Can I Make Changes to and Then Re-Save an Existing Excel Spreadsheet?

Microsoft Word
• How Can I Randomly Assign a Font to Characters in a Word Document?
• How Can I Find a Word in a Document and Change the Background Color of the Paragraph Where That Word Appears?
• How Can I Count the Number of Sentences and Paragraphs in a Word Document?
• How Can I Extract Specific Information From a Word Document and Then Use That Information to Rename the Document?
• How Can I Tally All the Items in a Microsoft Word Document?
• How Can I Reset the Revision Number of a Word Document to 1?
• How Can I Retrieve Field Values in a Microsoft Word Document?
• How Can I Change the Paragraph Case in Microsoft Word?
• How Can I Insert a Manual Line Break into a Microsoft Word Document?
• How Can I Search For and Modify Formatted Text in a Word Document?
• How Can I Search For Red Text in a Microsoft Word Document?
• How Can I Change the Default File Save Format in Microsoft Word?
• How Can I Put the File Name in the Footer of a Microsoft Word Document?
• How Can I Add a Page X of Y Footer to a Microsoft Word Document?
• How Can I Save Each Paragraph in a Word Document as a Database Record?
• How Can I Replace a Specified Font in a Microsoft Word Document?
• How Can I Apply a Theme to a Microsoft Word Document?
• How Can I Add the Last-Saved Date to the Footer of a Microsoft Word Document?
• How Can I Insert a Date Field in Word?
• How Can I Add a New Item to the Microsoft Word AutoCorrect List?
• How Can I Clear All the Formatting From a Microsoft Word Document?
• How Can I Change the Default Highlight Color for a Microsoft Word Document?
• How Can I Run a Macro After Opening Up Word?
• How Can I Center-Align a Picture in a Word Document?
• How Can I Change an Existing Hyperlink in a Microsoft Word Document?
• How Can I Add a Blank Line Between the Existing Paragraphs in a Word Document?
• How Can I Insert Text Into an Existing Microsoft Word Bookmark?
• How Can I Get a Total Page Count for All the Word Documents in a Folder?
• How Can I Set the Document Orientation in Microsoft Word to Landscape?
• How Can I Replace Text in a Microsoft Word Document?
• How Can I Search For (and Reformat) Highlighted Text in a Word Document?
• How Can I Get a List of the Unique Words Used in a Microsoft Word Document?
• How Can I Get a List of Available Metadata for Microsoft Office Documents?
• How Can I Add Multiple Tables to a Word Document?
• How Can I Search a Word Document for All the Words in Double Brackets?
• How Can I Add Centered Page Numbers to the Footer of a Word Document?
• How Can I Create a Table and Fill the First Column With a Range of Dates?
• How Can I Rename a Word Document Using the First Three Characters in That Document?
• How Can I Search for and Highlight Words in a Microsoft Word Document?
• How Can I Right-Align a Single Column in a Word Table?
• How Can I Boldface a Specific Word Throughout a Microsoft Word Document?
• How Can I Change the Font Name and Size for an Entire Word Document?
• How Can I Set Word’s Revision View Mode to Final?
• How Can I Insert Multiple Files Into a Word Document, Putting a Page Break Between Each File?
• How Can I Set Word’s Default File Location to be the User’s Home Directory?
• How Can I Open Word with the Cursor Positioned at the Start of a Specified Line?
• How Can I Change File Locations for Microsoft Word?
• How Can I Insert a Symbol into a Word Document?
• How Can I Hide a Specific Toolbar in Microsoft Word?
• How Can I Extract Word Paragraphs That Use a Specific Style?
• How Can I Insert Files into a Word Document?
• How Can I Convert 1,000 .RTF Files to Word Documents?
• How Can I Add a Hyperlink to a Word Document?
• How Can I Put the User Name into the Footer of a Microsoft Word Document?
• How Can I Determine Which Version of Word is Installed on a Computer?
• How Can I Save Word Documents as Text Files By Using a Script?

Microsoft Access
• How Can I Import Multiple Worksheets into an Access Database?
• How Can I Add a Record to a Database Using Windows PowerShell?
• How Can I Delete a Set of Records From an Access Database?
• How Can I Be Notified if an Access Database File Exceeds a Specific Size?
• How Can I Retrieve the Field Size and a Sample Record For All the Tables and Fields in an Access Database?
• How Can I List All the Fields and Data Types in an Access Database?
• How Can I Append a Value to a Specified Field For Each Record in a Database?
• How Can I Add the Contents of a Group of Text Files to an Access Database?
• How Can I Import a .CSV File into an Access Database?
• How Can I List All the Access Database Files on a Computer?
• How Can I Print a Microsoft Access Report?
• How Can I Compact an Access Database?
• How Can I Use Windows PowerShell to Pull Records From a Microsoft Access Database?
• How Can I List All the Tables in an Access Database?
• How Can I Determine Which Version of Access was Used to Create a Database?
• How Can I Delete a Table from a Jet Database?

Microsoft Outlook
• How Can I Schedule a Meeting Each Monday Through Friday For Two Weeks?
• How Can I Sort Items Retrieved From a Microsoft Outlook Folder?
• How Can I Set a Reminder on All My Outlook Appointments?
• How Can I Schedule an All-Day Event in Microsoft Outlook?
• How Can I Run a Script Any Time Outlook is Started?
• How Can I Determine the Age, in Years, of an Outlook Contact?
• How Can I Save the Attachments for All My New Outlook Messages?
• How Can I Convert an Extension Number to an Actual Phone Number?
• How Can I Create a New Folder in Microsoft Outlook?
• How Can I List the Addresses in My Sent Items Folder in an Excel Spreadsheet?
• How Can I Get a List of Appointments for a Specific Month?
• How Can I Save Emails That Are More Than One Month Old?
• How Can I Create a New Outlook Distribution List Based On the Membership of an Active Directory Group?
• How Can I Save All My Contacts as VCards?
• How Can I Delete Unread Emails That Are More Than 6 Months Old?
• How Can I Randomly Select an Email From an Outlook Mail Folder?
• How Can I List All the Meetings Scheduled By a Specified Person?
• How Can I Filter Outlook Messages By Email Address?
• How Can I List All the Members of a Microsoft Outlook Distribution List?
• How Can I Determine the Follow-Up Status of Outlook Emails?
• How Can I Tell If Any of My Contacts Have a Birthday This Month?
• How Can I Delete All the Messages in My Sent Items Folder?
• How Can I Start Outlook If It Isn’t Already Running?
• How Can I Connect to the Junk Mail Folder in Outlook?
• How Can I Get Access to a Mail Folder That Isn’t a Subfolder of My Outlook Inbox?
• How Can I Get a List of All the Senders’ Email Addresses in an Outlook Folder?
• How Can I Delete All the Email Sent From a Specific Person?
• How Can I Write a Script That Accesses All the Subfolders in My Outlook Inbox?
• How Can I Get Total Size and Number of Items in an Outlook Folder?
• How Can I Convert an Outlook Email Message into a Text File?
• How Can I Get a List of All the .PST Files on a Computer?

Microsoft PowerPoint
• How Can I Retrieve the User Name and User Initials From Microsoft PowerPoint?
• How Can I Copy Data from Excel to PowerPoint?
• How Can I Apply a New Template to a PowerPoint Presentation?
• How Can I Configure PowerPoint to Print Handouts Instead of Slides?
• How Can I Run a PowerPoint Slide Show From a Script?

Other Office Tasks
• How Can I Use Windows PowerShell to Look at All the Microsoft Office Documents in a Folder?
• How Can I Change the User Information in Microsoft Office?