#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Moving Companies

Moving Companies http://www.losangelesmovingservices.blogspot.com/
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 78
Default Moving Companies


In Sheet1
------------
Let's take A1 to be the cell
dependent on a random number

Put in A1: =1+RAND()



Sub TextFromOLmsg()

Const olFolderInbox = 6
Const olTxt = 0
Const ForReading = 1

Dim R As Integer

' Determine row of first available cell in "A:A"
R = Range("A65536").End(xlUp).Row + 1

Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objFolder = objNamespace.GetDefaultFolder(olFolderInbox)

Set colMailItems = objFolder.Items

Set FSO = CreateObject("Scripting.FileSystemObject")
strFileName = FSO.GetSpecialFolder(2) & "\TempMsg.txt"

Set objItem = colMailItems.GetLast()
objItem.SaveAs strFileName, olTxt

Set objFile = FSO.OpenTextFile(strFileName, ForReading)

Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
Cells(R, 1).Value = strLine
R = R + 1
Loop

objFile.Close
FSO.DeleteFile strFileName

Set objFolder = Nothing
Set objNamespace = Nothing
Set objOutlook = Nothing
Set FSO = Nothing


In Sheet2
-------------
Put in B1: =Sheet1!A1
List/fill sequentially in A2:A51, the numbers 1,2,3... 50

Select A1:B51
Click Data Table
Leave the "row input cell:" box empty
Put in the "column input cell:" box: C1
(C1 is arbitrary, it can any cell outside the range A1:B51)
Click OK

B2:B51 will be filled with 50* iterations of
the random formula result of Sheet1's A1
*disregarding the result in B1 itself

Each press of the F9 key will regenerate
another 50 iterations in B2:B51

Now you could just freeze the randomized values
in the range B2:B51
via a copy paste special values in-situ or elsewhere
--



"linkswanted" wrote:

Moving Companies http://www.losangelesmovingservices.blogspot.com/

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
Counting Individual Companies Nigel Excel Discussion (Misc queries) 6 January 4th 08 12:25 PM
analysing companies - help!! therum Excel Discussion (Misc queries) 2 April 1st 07 01:06 AM
How do I consolidate balance sheets from different companies Mary F Excel Discussion (Misc queries) 0 June 27th 06 04:10 PM
filter companies that does not perform a year Bram Excel Discussion (Misc queries) 4 October 11th 05 03:52 PM
I want to pull out companies without an email address? Pudlicious Excel Worksheet Functions 0 March 15th 05 04:43 PM


All times are GMT +1. The time now is 01:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"