Results 1 to 11 of 11

Thread: write into excel

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    write into excel

    i have code below capturing sendername and date sent to excel with specific subject
    but i will also need to capturing received time against the sendername in excel
    please help me in the below code.
    thanks for your great help,
    Code:
    i = Sheets("Sheet1").Range("A65536").End(xlUp).Row + 1
      For Each olMail In Fldr.Items 
    
    For Each olMail In Fldr.Items
        MyArray = Trim(Split(olMail.Subject, "-")(0))
    If olMail.SenderName = "xxx" Or olMail.SenderName = "xxxx" Or olMail.SenderName = "xxxxx" Then
    
       If MyArray = "Password Permit" Then
         ActiveSheet.Cells(i, 1).Value = olMail.To
      ActiveSheet.Cells(i, 2).Value = olMail.SentOn
     i = i + 1
     End If
    End If
     
     Next olMail
     
        Set Fldr = Nothing
        Set olNs = Nothing
        Set olApp = Nothing
          
      
     Application.ScreenUpdating = True

  2. #2
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: write into excel

    but i will also need to capturing received time against the sendername in excel
    But I answered this question on 21st Jul 2010

    http://www.vbforums.com/showpost.php...6&postcount=10
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Re: write into excel

    Kool
    i tried it . but i could not get received time against the sendername in excel
    captured received time in differrent row not the same row which senndername is ? could you help me

  4. #4
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: write into excel

    Show the code that you are using for received time.
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Re: write into excel

    this is the code for received time
    Last edited by kamakshi; Aug 10th, 2010 at 08:09 PM.

  6. #6
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: write into excel

    kamakshi: The code is correct...

    Can you show me the complete code so that I can test it at my end?

    Also

    For Each olMail In Fldr.Items
    is mentioned twice in post#1. Is it a typo?
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Re: write into excel

    here is the code
    Last edited by kamakshi; Aug 10th, 2010 at 08:09 PM.

  8. #8
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: write into excel

    kamakshi, I feel that you have just copied and pasted that code in your Application from a different source. No offense meant but do you actually understand what the code is doing?
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Re: write into excel

    kool
    before this code it copied everyhtin senderanme and sent on in excel
    but i need to compare sendername in excel against outlook adn copy the received time the exact column
    for example fir the row 15 i havesender name the macro corresponding row columnn 3 will be paste received time from outlook
    the below code i added it does not go in
    Last edited by kamakshi; Aug 10th, 2010 at 08:08 PM.

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Re: write into excel

    Hi!
    from outlook to excel copied sendername and date sent on
    and thenk outlook received mail check with excel sendername and then copy received item in the excel
    first one part is fine but second part it picksup from outlook but not in right row. Could anybody help me
    Last edited by kamakshi; Aug 10th, 2010 at 08:08 PM.

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Re: write into excel

    Set c = .Find(olItem.SenderName, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=SearchOrder, SearchDirection:=SearchDirection, MatchCase:=False, SearchFormat:=False)
    Last edited by kamakshi; Aug 10th, 2010 at 08:08 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width