+ Reply to Thread
Results 1 to 9 of 9

Novice - Need help to break down code smaller

  1. #1
    Registered User
    Join Date
    05-11-2018
    Location
    Trinidad
    MS-Off Ver
    2013
    Posts
    9

    Novice - Need help to break down code smaller

    Novice.

    Some advice how to break this down please:

    Please Login or Register  to view this content.

    Thanks.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Novice - Need help to break down code smaller

    When you posted this before, I did ask you to add more detail as to what you want with this?
    Last edited by alansidman; 05-12-2018 at 04:11 PM.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Novice - Need help to break down code smaller

    I'm going to take advantage of the mathematical relationship I noticed between the number in the shape name and the target row.
    Please Login or Register  to view this content.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  4. #4
    Registered User
    Join Date
    05-11-2018
    Location
    Trinidad
    MS-Off Ver
    2013
    Posts
    9
    Quote Originally Posted by FDibbins View Post
    When you posted this before, I did as you to add more detail as to what you want with this?
    Sorry. Thought you meant to make a separate
    thread only.

    The module goes up to 150 shapes but I get a compile error - procedure too large and would like some help to break it down to smaller/shorter coding.

    Hope this clears up my question and sorry for being vague before.

    Thanks. Chris.

  5. #5
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Novice - Need help to break down code smaller

    If the mathematical relationship does not hold up for all 150 shapes, then I recommend creating an Excel table with target cell addresses and the shape to which they apply. Then you can loop through the table, look up the data and apply the width hand heights found in the table. The advantage of this is that if things change, you only have to change the data and not the code.

  6. #6
    Registered User
    Join Date
    05-11-2018
    Location
    Trinidad
    MS-Off Ver
    2013
    Posts
    9

    Re: Novice - Need help to break down code smaller

    Thanks. I will try your suggestion later and revert.

    One question: What does the - 3 after Target.Row relate to?


    Thanks. Chris.

  7. #7
    Registered User
    Join Date
    05-11-2018
    Location
    Trinidad
    MS-Off Ver
    2013
    Posts
    9

    Re: Novice - Need help to break down code smaller

    This is very close to getting it. Only issue is that it works for width but not height. Guessing I need two codes to do each dimension separately?!

    150 Shapes:

    Column Range from BA4 to BA153 * Cell BA157 will give Width values for each Shape (Target.Row - 3)

    And

    Column Range from BB4 to BB153 * Cell BA159 will give Height values for each Shape (Target.Row - 3).

    Any ideas?

    Thanks. Chris.

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,879

    Re: Novice - Need help to break down code smaller

    Rule 08: Cross-posting Without Telling Us

    Your post does not comply with Rule 8 of our Forum RULES. Do not cross-post your question on multiple forums without telling us about your threads on other forums.

    Post a link to any other forums where you have asked the same question. If you have fewer than 10 posts here, you will not be able to post a link, but you must still tell us where else you have asked the question.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    No further help to be offered, please, until the OP has complied with this request.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  9. #9
    Registered User
    Join Date
    05-11-2018
    Location
    Trinidad
    MS-Off Ver
    2013
    Posts
    9
    Apologies. I thought the cross post meant in same website forum. Just trying to get this Code resolved so decided to look for extra assistance.

+ 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. [SOLVED] is a smaller code better or just looks better?
    By kevinu in forum Excel General
    Replies: 1
    Last Post: 05-11-2018, 10:58 AM
  2. help with making vba code smaller
    By vendetta907 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-17-2016, 03:57 PM
  3. [SOLVED] Break excel 120k lines file into smaller 10k line Microsoft 97 files
    By ejdrouil in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2014, 08:06 PM
  4. make VBA code smaller
    By roberto1111 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-14-2009, 02:52 PM
  5. Making this code smaller
    By roberto1111 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-07-2009, 03:38 PM
  6. [SOLVED] How do I break a csv file into smaller size for export?
    By svb in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 12-21-2005, 07:55 PM
  7. VB code needed as this is way beyond a novice like me!
    By Anthony in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-10-2005, 03:05 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