+ Reply to Thread
Results 1 to 12 of 12

macro work but very slow

  1. #1
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Post macro work but very slow

    Please Login or Register  to view this content.
    dear friends i don't have VB knowledge.i have found two macro from net & i have make above macro.it's work but it's take too much time.pls any body can remake this macro to run fast.thanks.
    Last edited by johncena; 04-04-2010 at 11:48 AM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: macro work but very slow

    The Slow part is

    Please Login or Register  to view this content.
    Do you have to loop through all 1192 cells in this range?

  3. #3
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Re: macro work but very slow

    dear Marcol my data range is not fix.some time it's 5 rows,some time it's 100 rows.pls u can make this to run in used data range.pls help me.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: macro work but very slow

    Move your LR resolution up to the top and then use it in the first FOR/EACH like you did for the second. That should help some.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Re: macro work but very slow

    sir JBeaucaire thanks for your reply.i am downloading data from my system to excel.after that i have tp copy that data to my worksheet.on that data i have try to run my macro & it's not work.then my friend told me with that data has some extra space before running the macro i should remove that space.for that i try above macro first part & it's work..
    second part u can understand i want to add each values in column "J " to equal " = "
    that last part i have take from macro record & i want to remove column "E" all " - ",column "D to H" all space also i want to remove.
    i think now u have some idea about my macro...

  6. #6
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: macro work but very slow

    maybe to use

    Please Login or Register  to view this content.
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  7. #7
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: macro work but very slow

    Or ... when using ws functions

    Please Login or Register  to view this content.
    .
    This will give you a much better performance.
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  8. #8
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Re: macro work but very slow

    thanks u very much for your all helps.pls any body can give me the complete macro code.thanks.

  9. #9
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: macro work but very slow

    In response to your PM

    Try this, it uses rwgrietvelds' suggestion and a bit of guess work

    Please Login or Register  to view this content.

    A sample workbook would help to clear up any guesswork.

    Cheers

  10. #10
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Post Re: macro work but very slow

    thanks sir Marcol.it's almost work.some cells has data like this.'12/2.i have used " ' " (apostrophe) before typing 12/2 because other wise it's automatically change to date format like this." 2-Dec ".after running this macro.that my apostrophe disappear & it's again change to " 2-Dec ".
    this part i want to run only in column "D" to "G" range only.i don't want to run whole sheet..
    Please Login or Register  to view this content.
    Last edited by johncena; 04-04-2010 at 10:41 AM.

  11. #11
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: macro work but very slow

    Try this

    Please Login or Register  to view this content.
    If this doesn't work

    A sample workbook would help to clear up any guesswork

    Cheers

    EDIT:

    Missing lines

    Please Login or Register  to view this content.
    Sorry for that.

    Better if each section is written as a function.
    Last edited by Marcol; 04-05-2010 at 04:28 AM. Reason: Missed 2No. lines in code

  12. #12
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Re: macro work but very slow

    thanks u very much sir Marcol.it's work very well.thanks a lot again.REP+

+ Reply to Thread

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