+ Reply to Thread
Results 1 to 12 of 12

Is there any way I can shorten out or to eliminate unneeded code.

  1. #1
    Registered User
    Join Date
    12-17-2020
    Location
    dallas
    MS-Off Ver
    365
    Posts
    7

    Is there any way I can shorten out or to eliminate unneeded code.

    Hello

    I was wondering if there was anyway that I can shorten my following code or remove unneeded code,

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Jesus166; 12-17-2020 at 03:18 PM.

  2. #2
    Registered User
    Join Date
    12-17-2020
    Location
    dallas
    MS-Off Ver
    365
    Posts
    7

    Re: Is there any way I can shorten out or to eliminate unneeded code.

    I just attached the Excel file , but basically it copies cells from the cover page to paste them on a refence page that we send to a coworker to file on a data base.

  3. #3
    Registered User
    Join Date
    12-17-2020
    Location
    dallas
    MS-Off Ver
    365
    Posts
    7

    Re: Is there any way I can shorten out or to eliminate unneeded code.

    I get the procedure too large issue, but on my old excel sheet it works perfectly and the only thing I added to the current one is a few extra cells that needed to be copied.

  4. #4
    Registered User
    Join Date
    12-17-2020
    Location
    dallas
    MS-Off Ver
    365
    Posts
    7

    Re: Is there any way I can shorten out or to eliminate unneeded code.

    Thanks' for the help, hopefully that will be a good start.

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    12,440

    Re: Is there any way I can shorten out or to eliminate unneeded code.

    Quickest & easiest way is like
    Please Login or Register  to view this content.
    You can also do a direct copy values like
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    12-17-2020
    Location
    dallas
    MS-Off Ver
    365
    Posts
    7

    Re: Is there any way I can shorten out or to eliminate unneeded code.

    I will try them when I get to work tomorrow

  7. #7
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    1,914

    Re: Is there any way I can shorten out or to eliminate unneeded code.

    Based on the "20200.txt" file.
    I didn't check the "xls" file.
    There may be bugs.

    Ps.: Code in the "txt" file - forum firewall blocks code pasted directly ... : ( ?!
    Attached Files Attached Files
    Last edited by mjr veverka; 12-17-2020 at 08:29 PM.

  8. #8
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010, 2019
    Posts
    2,252

    Re: Is there any way I can shorten out or to eliminate unneeded code.

    Quote Originally Posted by Jesus166 View Post
    ...but basically it copies cells from the cover page to paste them on a refence page...
    Unless you original file's code has an error in it, it looks like you are copying from two different worksheets, one named "KRPA" and the other named "KRPA 2". Is that correct?

  9. #9
    Registered User
    Join Date
    12-17-2020
    Location
    dallas
    MS-Off Ver
    365
    Posts
    7
    Quote Originally Posted by Rick Rothstein View Post
    Unless you original file's code has an error in it, it looks like you are copying from two different worksheets, one named "KRPA" and the other named "KRPA 2". Is that correct?
    Well Krpa or Krpa 2 to sheet Rpa. But normally only sheet Krpa will be copied to RPA sheet unless I have more that 10 different part numbers and need more space so I would love to KRpa 2 .

  10. #10
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010, 2019
    Posts
    2,252

    Re: Is there any way I can shorten out or to eliminate unneeded code.

    .
    *** IGNORE -- I did not see you posted a file until now ***
    Last edited by Rick Rothstein; 12-18-2020 at 12:38 AM.

  11. #11
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,559

    Re: Is there any way I can shorten out or to eliminate unneeded code.

    Hi Jesus166,

    Try the below code & see if this does what you need ...
    Please Login or Register  to view this content.
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

  12. #12
    Registered User
    Join Date
    12-17-2020
    Location
    dallas
    MS-Off Ver
    365
    Posts
    7

    Re: Is there any way I can shorten out or to eliminate unneeded code.

    Quote Originally Posted by nankw83 View Post
    Hi Jesus166,

    Try the below code & see if this does what you need ...
    Please Login or Register  to view this content.
    this one seems to work, I will probably have to adjust it a bit.

+ 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. Shorten VBA Code
    By capt_rakeshshah in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-14-2017, 12:11 PM
  2. [SOLVED] Represent (define?) a section of code with a variable (shorten long code lines)?
    By Gene@action in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-01-2016, 03:59 PM
  3. [SOLVED] How to Shorten my VBA Code?
    By JRidge in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-30-2014, 06:07 AM
  4. To shorten the code
    By gan_xl in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-05-2014, 04:38 AM
  5. [SOLVED] Very inefficient code because of different sizes of arrays, how do i shorten my code?
    By Brammer88 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-28-2012, 04:49 PM
  6. code to delete unneeded codes before save
    By 2funny4words in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 09-06-2010, 02:46 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