Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA "Excel & Outlook" **************
Hi everyone,
I am having lots of difficulties with tonnes of data on back of my head. Basically, I have about 120 outlook emails saved on my drive. Each email file obviously have different names. Q: what I am trying to achieve is to be able to paste all the emails to seperate worksheets in one workbook or look up or whatever case may be, Looking up values on cells A1 to A50 on activesheet on all emails then returning the name of email that has the value on the next column B1 to B50. What I can do now so far with help from wonderful people here in google groups is this; - Searching through entire worksheets for values listed from cell A1 to A50, if value is found then displaying the name of the particular worksheet or worksheets on B1 to B50 Sub SearchAllSheets() For i = 1 To 50 If Range("A" & i) < "" Then Range("B" & i).ClearContents For Each sh In Worksheets If sh.Name < ActiveSheet.Name Then Set searchresult = sh.Cells.Find(Range("A" & i), _ lookat:=xlPart) If Not searchresult Is Nothing Then Range("B" & i) = Range("B" & i) & " " & " | " & sh.Name End If End If Next End If Next End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA "Excel & Outlook" **************
hi James,
you need a macro to import all your emails in different sheets of a workbook. use the macro-recorder to record the import of one email. post your code here to create a loop for all emails (are they in the same directory?) stefan On 21 Mai, 09:15, James8309 wrote: Hi everyone, I am having lots of difficulties with tonnes of data on back of my head. Basically, I have about 120 outlook emails saved on my drive. Each email file obviously have different names. Q: what I am trying to achieve is to be able to paste all the emails to seperate worksheets in one workbook or look up or whatever case may be, Looking up values on cells A1 to A50 on activesheet on all emails then returning the name of email that has the value on the next column B1 to B50. What I can do now so far with help from wonderful people here in google groups is this; - Searching through entire worksheets for values listed from cell A1 to A50, if value is found then displaying the name of the particular worksheet or worksheets on B1 to B50 Sub SearchAllSheets() For i = 1 To 50 If Range("A" & i) < "" Then Range("B" & i).ClearContents For Each sh In Worksheets If sh.Name < ActiveSheet.Name Then Set searchresult = sh.Cells.Find(Range("A" & i), _ lookat:=xlPart) If Not searchresult Is Nothing Then Range("B" & i) = Range("B" & i) & " " & " | " & sh.Name End If End If Next End If Next End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel | |||
"LabelColor" an appointment in Outlook with VBA in Excel. | Excel Programming | |||
Creating "Plain Text" mail message in Outlook from Excel VBA | Excel Programming |