Getting : Compile Error - Procedure too long.
Please help me to shorten my VBA Code.
Please Login or Register to view this content.
Getting : Compile Error - Procedure too long.
Please help me to shorten my VBA Code.
Please Login or Register to view this content.
Last edited by capt_rakeshshah; 05-11-2017 at 06:33 AM. Reason: To comply to Forum rules
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.
Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.
Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
(This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
Ben Van Johnson
Welcome to our forum. You obviously did not take the time to read our few forum rules. Please do so now as you have not followed at least two of them.
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.
Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.
Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
Also----
Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.
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).
This thread should not receive any responses until the OP complies 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
Edit: cross-posted with mod above (with similar statement), so post removed
Regards,
Aardigspook
I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
You don't need to give me rep if I helped, but a thank-you is nice.
Welcome to the forum. Unfortunately ...
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.
Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.
Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
It's only 471 rows and it compiles OK for me.
The first couple of sections can be shortened like this ... you'll see the pattern:
Please Login or Register to view this content.
With a little effort, it could be put in a loop
Please Login or Register to view this content.
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
Sorry guys; didn't refresh. Same message but I thought I'd give some guidance too
Sorry for the mistake.
Have done necessary changes as asked to do.
Looking for guidance from the experts.
Thank you.
Thank you. Did you look at the solution I proposed? It's not the best but it will very much shorten the current code.
OK, just looked at the code in the text file; I had assumed that it was the same as the code you included in the post. So, there are just short of 2,600 lines of code, hence the issue.
A brief check seems to indicate a lack of consistence in the cells that are copied and pasted to. That means a loop is less practical than it might have been hoped.
However, the edits I made to the first couple of blocks looks to halve the original code. So, if you applied that approach to the rest of the code, you'd get down to about 1,300-1,400 lines of code. That would probably be enough to allow compilation.
If you could indicate a pattern in relation to which cells are copied and where they are pasted, it might be possible to produce a loop which would reduce the code significantly.
Sir, With your permission would like to share the file that i am working on. My problem is with code assigned to Macro8. Thank you.
Try this. Note that it is limited to the first 30 entries for testing purposes. As screen updating is off, it is not obvious that anything is happening, hence I have added a Debug.Print
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks