+ Reply to Thread
Results 1 to 15 of 15

How to Optimize This Code?

Hybrid View

  1. #1
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,957

    Re: How to Optimize This Code?

    Post 10 above is actually the way to go with this problem...as it just references the required column and replaces the correct lookup found values...
    The first is that it clears the following column to the right
    This was just a solution for your sample file uploaded...One would need to use a helper column at end of data...
    I can't run another macro that concatenates the values on column M and N
    As far as above...One can only see if you upload a sample file to test...As we cannot recreate the issue

    Just for future reference...the below declarations...
    Only the red ones are actually declared...the ones prior without As are declared as variants...

    Dim cel, fr As Range
    Dim k, g, ofst, lr, frr As Long
    Dim i, j As Long
    Should be...
    Dim cel As Range, fr As Range
    Dim k As Long, g As Long, ofst As Long, lr As Long, frr As Long
    Dim i As Long, j As Long
    Last edited by Sintek; 03-20-2021 at 03:13 AM.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Optimize Code
    By floppygoat in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-04-2020, 04:52 AM
  2. optimize code if possible
    By mohadin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-01-2019, 06:18 AM
  3. How can I optimize my code
    By viettest in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-08-2019, 05:02 PM
  4. Optimize a code
    By pezalmendra in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-06-2015, 05:31 PM
  5. Optimize code
    By DarkKnightLupo in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 02-19-2014, 08:58 AM
  6. Optimize code
    By miso.dca in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-08-2011, 03:35 PM
  7. Optimize VBA code
    By doodlebug in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2007, 07:53 AM

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