+ Reply to Thread
Results 1 to 13 of 13

Need Professional Correction

  1. #1
    Registered User
    Join Date
    11-14-2011
    Location
    Dusseldorf, Germany
    MS-Off Ver
    Excel 2003
    Posts
    97

    Need Professional Correction

    Hello,

    I have recorded the below code. and would like your corrections and suggestions how to make it better and more flecible:

    Some points:

    1. Need to work with 3 files -> Copy data to one file (Is it possible to enter the names of that files in the start of the code)
    2. Range of the sheets are different each time... I have set up for example Range("J2:J1000000") or Range("$A$2:$Q$1000000") is it possible not to have the maximum one... just use all that are in the sheet?
    3. While the macro is running, you can see that other Macros are executed... is that correct? or they should be implemented in the code somehow?
    4. Your suggestions!

    Please Login or Register  to view this content.
    Thank you in advance
    Last edited by yiannis1925; 12-20-2011 at 11:15 AM.

  2. #2
    Registered User
    Join Date
    11-14-2011
    Location
    Dusseldorf, Germany
    MS-Off Ver
    Excel 2003
    Posts
    97

    Re: Need Professional Correction

    would really appreciate a help here...

    thank you

  3. #3
    Registered User
    Join Date
    11-14-2011
    Location
    Dusseldorf, Germany
    MS-Off Ver
    Excel 2003
    Posts
    97

    Re: Need Professional Correction

    I changed the code a little bit... but still need your help...

    Thank you in advance...

    Please Login or Register  to view this content.

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Need Professional Correction

    For example, instead
    Please Login or Register  to view this content.
    try to write so
    Please Login or Register  to view this content.
    Next is not clear.

  5. #5
    Registered User
    Join Date
    11-14-2011
    Location
    Dusseldorf, Germany
    MS-Off Ver
    Excel 2003
    Posts
    97

    Re: Need Professional Correction

    thank you very much nilem... here is the code again... and I explain what is being done:

    Please Login or Register  to view this content.
    1. The file that is opened have one sheet with data. all data is being copied to a new sheet that is created and named "Analysis"

    Please Login or Register  to view this content.
    2. Two files is being opened and sheets "Keywordlist", "NegativeMaster", "cities" and copied to our main file... which is currently called "B-GR-BM-GR_EN-STA6.xlsx"

    Please Login or Register  to view this content.
    3. Two macros executed (is it ok to execute them like this?or they should be implemented incode?)

    Please Login or Register  to view this content.
    4. Enother makro is executed. Then we get a filter on tab Action(E2) for "True" and delete all these rows. and a last makro is executed in the end.

    Please Login or Register  to view this content.
    hope it is better this way.

    Thank you

  6. #6
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Need Professional Correction

    Instead of
    Please Login or Register  to view this content.
    try this
    Please Login or Register  to view this content.
    In all cases remove 'Select'. For example, instead
    Please Login or Register  to view this content.
    we write
    Please Login or Register  to view this content.
    Here is not clear. Write in words what you want to do in this piece of code:
    Please Login or Register  to view this content.

  7. #7
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Need Professional Correction

    ----------
    Last edited by nilem; 12-09-2011 at 07:50 AM. Reason: repetition

  8. #8
    Registered User
    Join Date
    11-14-2011
    Location
    Dusseldorf, Germany
    MS-Off Ver
    Excel 2003
    Posts
    97

    Re: Need Professional Correction

    Thank you for your help... here is the code as it is now

    Please Login or Register  to view this content.
    Any comments?

    The problem is here for sure:
    Please Login or Register  to view this content.
    it should filter for true (that is done)... and delete all these cells...(that is not working)

    another strange thing is that here... it adds "Action", "Negative Element", "Negative Category", "Implementation" to B3:E3 for some reason!
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    11-14-2011
    Location
    Dusseldorf, Germany
    MS-Off Ver
    Excel 2003
    Posts
    97

    Re: Need Professional Correction

    Mogy i por Ryski ne ploxo govorit )

  10. #10
    Registered User
    Join Date
    11-14-2011
    Location
    Dusseldorf, Germany
    MS-Off Ver
    Excel 2003
    Posts
    97

    Re: Need Professional Correction

    Ok, I managed to correct everything... so it looks to work good now... is there any suggestions on how to improve the code now?

    Please Login or Register  to view this content.

  11. #11
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Need Professional Correction

    Well, as an option
    Please Login or Register  to view this content.

  12. #12
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Need Professional Correction

    Here's a cleaner version of your code.

    Please Login or Register  to view this content.
    Also why do you use:

    Please Login or Register  to view this content.
    to call your subs? Are they housed in a different workbook than the current one? If not then you cand drop this altogether. Also filtering a million rows is probably overkill unless you actually have that much data. Its better to just use the actual number of rows that are populated in your worksheet by find the last row with something like:

    Please Login or Register  to view this content.
    Hope this helps.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  13. #13
    Registered User
    Join Date
    11-14-2011
    Location
    Dusseldorf, Germany
    MS-Off Ver
    Excel 2003
    Posts
    97

    Re: Need Professional Correction

    thank you very much for the help...

    I removed already the
    Please Login or Register  to view this content.
    and changed it to
    Please Login or Register  to view this content.
    it is another code that is being executed.

    the
    Please Login or Register  to view this content.
    seems to work good.

    so the code looks like this now... and seems to work good:

    Please Login or Register  to view this content.
    I have created a new post... were I want to make some checks to the code before it could be run... is that possible? please look here http://www.excelforum.com/excel-prog...-the-code.html

    Thank you very much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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