View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default Compile Error: Procedure too Large Question

Hi,
Consider holding the target address and corresponding ranges in a
table and using VLOOKUP or INDEX/MATCH. The code would only be a minor
modification to your code below.

VLOOKUP table would be of format

Target Address Data Range
$G$9748 F9745:I9753


HTH

"Daniel R. Young" wrote:

I cannot make it smaller. Here is the code:
If Target.Address = "$G$9748" Then
If Me.Range("G9748").Value = "Yes" Then
Application.Dialogs(xlDialogInsertPicture).Show
Selection.Height = Range("F9745:I9753").Height
Selection.Width = Range("F9745:I9753").Width
Selection.Top = Range("F9745:I9753").Top
Selection.Left = Range("F9745:I9753").Left
Selection.Placement = xlMoveAndSize
End If
End If
This is repeated 176 times with different values. Is there a way to make it
smaller?

"JM" wrote:

Umm, make it smaller?




"Daniel R. Young" wrote in message
...
If my procedure is too large what can I do to make it work?

Thank you,

Daniel