Dynamic macro's

E

Ekser

Thanks!

So, i wanted to declare and code each situation separately, as a shee
represents a month, it is "limited" to 31 rows.

BUT

After coding the Else If case n° 19, I receive an error:

Compile Error:

Procedure too large

?!!

It says that the procedure is limited to 64 k and that I should spli
my macro.


How can I do this, if I want the macro to be activated by pressing onl
one button?
 
D

Dave Peterson

You may want to post a snippet of your code (not all 64k) to ask what can be
done to improve/reduce it.

I'm gonna guess that you have a lot of .selects and .activates and maybe scroll
right/left/up/down in your code.

If you do, it's not usually necessary to select something to work with it.

But that's just a guess (about your code--not the tip!).
 
A

AlfD

Hi!

This all sounds a bit pessimistic!

Have you looked at using the Worksheet_SelectionChange event t
identify the row your user has clicked? This generates a variabl
(Target) from which Target.Row and Target.Column can be extracted.

Once you've got the row number (Target.Row) - let's call it RowNo -
you can transfer the data using statements like

Worksheets("Data").Range("B3").Value=Worksheets("Template").Range("A"
RowNo).Value.

Al
 
Top