+ Reply to Thread
Results 1 to 3 of 3

New to VBA - Want to clean up my code and have it run faster

  1. #1
    Registered User
    Join Date
    03-20-2024
    Location
    Tennessee, US
    MS-Off Ver
    6402
    Posts
    1

    New to VBA - Want to clean up my code and have it run faster

    I have just started out trying to learn VBA code. Essentially what I want this code to do it is open the source workbook, then find the corresponding month (based on a drop down in a cell in the destination workbook), then go through the source workbook and match up the line item from the destination workbook, and paste the value in the correct month in the destination workbook. I currently have it so that it will just loop through each line item in the destination workbook and match it from the source workbook. However, it seems like my code is a little bloated and it runs kind of slow. I was wondering if there was any way to clean it up so that it will run faster. Any help or tips are appreciated!

    Please Login or Register  to view this content.

  2. #2
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: New to VBA - Want to clean up my code and have it run faster

    Not entirely sure, but this line looks like you're looping through every column (+16K). It might be why your code takes a bit of time to run.
    Please Login or Register  to view this content.

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: New to VBA - Want to clean up my code and have it run faster

    No need for any loops at all...Will be so much easier if you could supply sample files and show expected result explaining the process...see yellow banner above regarding upload...
    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 star to left of post [Add Reputation]
    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. Need help to make code faster (The code copy/paste)
    By Beginner77 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 09-13-2023, 05:16 PM
  2. [SOLVED] VBA Code to Hide Rows Based on Cell Value faster (VBA Code Slow)
    By dharvey1978 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-18-2022, 03:44 AM
  3. VBA Code clean up
    By DHHM in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-21-2015, 03:41 AM
  4. Have VBA code that needs performed in multiple sheets. Also help being sure code is clean
    By baby_kay_2003 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-17-2014, 10:57 PM
  5. Clean up code
    By madhatter40 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2014, 09:21 AM
  6. Code clean up
    By zplugger in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-07-2012, 07:17 PM
  7. [SOLVED] VBA Code to optimize and clean data- clean out numerical/ or symbol
    By tracylsr in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-05-2012, 04:21 PM

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