Results 1 to 6 of 6

To improve Efficiency of code, code running too long

Threaded View

andywsw To improve Efficiency of... 06-18-2012, 09:53 PM
rylo Re: To improve Efficiency of... 06-18-2012, 11:37 PM
andywsw Re: To improve Efficiency of... 06-19-2012, 12:25 AM
rylo Re: To improve Efficiency of... 06-19-2012, 01:20 AM
andywsw Re: To improve Efficiency of... 06-19-2012, 04:45 AM
rylo Re: To improve Efficiency of... 06-19-2012, 05:54 PM
  1. #1
    Registered User
    Join Date
    04-09-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    54

    To improve Efficiency of code, code running too long

    Hi guys,

    i have this code to be run on excel. What i have done previously was spliting the email message body each text to each cells before running this code.

    However every alternate cells has a blank cell for this particular sender( i have many sender with different formart, only this affecting) so by running this code will take out all the blank cells. i also notice that the blank cell contains Chr(10) .


    This code is working but taking way too long to process for just one email only. So is there anyway to improve on this ? Timing for this was 30 sec ~ 50 Sec to process ( using timer ). About me i am new to VBA , those codes is i happen to learn through the net.

    Thanks in an advance !



    Range("F2").Select
    Do Until IsEmpty(ActiveCell.Value)
    If ActiveCell.Offset(0, -4).text = "abc@sss.com" Then
        Do Until IsEmpty(ActiveCell.Value)
        If ActiveCell.Value = Chr(10) Then
        Selection.Delete Shift:=xlToLeft
        End If
        ActiveCell.Offset(0, 1).Select
        Loop
    End If
    ActiveCell.Offset(1, 0).Select
    Loop
    Last edited by andywsw; 06-18-2012 at 09:55 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1