Compile Error: Procedure too large OH NO!

largeselection

Active Member
Joined
Aug 4, 2008
Messages
358
Finally got all the bits and pieces working together (in I'm sure the dirtiest way), but it seemed to be doing what I wanted, then when I tried to expand it...fail.

Rundown: I have a workbook where I select checkboxes (cells) on the first tab, and then a macro copies the corresponding column from a data sheet and pastes it onto a report sheet.

It uses a LOT of these:
If Not IsEmpty(Range("M51")) Then
Builder "COLUMN A"
End If
If Not IsEmpty(Range("N51")) Then
Builder "COLUMN B"
End If
.
.
.
ETC

Where Builder is the macro that says search for the header "COLUMN A" in the Data sheet and copy it to the Report sheet.

I guess I have too many of those "If Not IsEmpty" sets (since I have 1000 or so "checkboxes" and each one refers to a specific column of data.

Any Suggestions? I thought I was so close to having this done :(
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Why do you have 1000 checkboxes?

Please don't tell me that you are repeating this code so many times.:)
 
Upvote 0
As I mentioned, it's pretty dirty...

I did repeat that bit of code 1000 times (using excel's find/replace/concatenate/layering in the worksheet to build the code).

I seem to have found a workaround by just separating all those bits into thirds.

So in the main click macro I have call testclick1, then call testclick 2, then call testclick 3.

Seems to be working ok. I haven't been able to find a less messy (or more elegant) way to get done what I need to get done.
 
Upvote 0

Forum statistics

Threads
1,215,472
Messages
6,125,005
Members
449,203
Latest member
Daymo66

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top