LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Procedure too large error

Thanks alot, I'll give it a try.
Phil

"Don Guillett" wrote:

I misread the request. Try this idea.

Sub cellbasedonfind()
On Error Resume Next
Range("d1") = Range("b2:b22").Find("emm1").Row - 1
'etc
End Sub

--
Don Guillett
SalesAid Software

"phil-rge-ee" wrote in message
...
I wrote some code that has become to large. I get a compile error:
procedure
to large when I try to run it(from a button click). I need help re-writing
it
so its smaller. Here is the code, this example is for just one employee, i
have to do this for 9 employees in total, that's why it gets to big.

Private Sub CommandButton7_Click()
'employee #1
'logged in time
If Range("BF2").Text = "Employee #1" Then Range("BP19").Value = 1 Else
If Range("BF3").Text = "Employee #1" Then Range("BP19").Value = 2 Else
If Range("BF4").Text = "Employee #1" Then Range("BP19").Value = 3 Else
If Range("BF5").Text = "Employee #1" Then Range("BP19").Value = 4 Else
If Range("BF6").Text = "Employee #1" Then Range("BP19").Value = 5 Else
If Range("BF7").Text = "Employee #1" Then Range("BP19").Value = 6 Else
If Range("BF8").Text = "Employee #1" Then Range("BP19").Value = 7 Else
If Range("BF9").Text = "Employee #1" Then Range("BP19").Value = 8 Else
If Range("BF10").Text = "Employee #1" Then Range("BP19").Value = 9 Else
'availability
If Range("BJ2").Text = "Employee #1" Then Range("BQ19").Value = 1 Else
If Range("BJ3").Text = "Employee #1" Then Range("BQ19").Value = 2 Else
If Range("BJ4").Text = "Employee #1" Then Range("BQ19").Value = 3 Else
If Range("BJ5").Text = "Employee #1" Then Range("BQ19").Value = 4 Else
If Range("BJ6").Text = "Employee #1" Then Range("BQ19").Value = 5 Else
If Range("BJ7").Text = "Employee #1" Then Range("BQ19").Value = 6 Else
If Range("BJ8").Text = "Employee #1" Then Range("BQ19").Value = 7 Else
If Range("BJ9").Text = "Employee #1" Then Range("BQ19").Value = 8 Else
If Range("BJ10").Text = "Employee #1" Then Range("BQ19").Value = 9 Else
'calls presented
If Range("BB19").Text = "Employee #1" Then Range("BR19").Value = 1 Else
If Range("BB20").Text = "Employee #1" Then Range("BR19").Value = 2 Else
If Range("BB21").Text = "Employee #1" Then Range("BR19").Value = 3 Else
If Range("BB22").Text = "Employee #1" Then Range("BR19").Value = 4 Else
If Range("BB23").Text = "Employee #1" Then Range("BR19").Value = 5 Else
If Range("BB24").Text = "Employee #1" Then Range("BR19").Value = 6 Else
If Range("BB25").Text = "Employee #1" Then Range("BR19").Value = 7 Else
If Range("BB26").Text = "Employee #1" Then Range("BR19").Value = 8 Else
If Range("BB27").Text = "Employee #1" Then Range("BR19").Value = 9 Else
'calls answered
If Range("BF19").Text = "Employee #1" Then Range("BS19").Value = 1 Else
If Range("BF20").Text = "Employee #1" Then Range("BS19").Value = 2 Else
If Range("BF21").Text = "Employee #1" Then Range("BS19").Value = 3 Else
If Range("BF22").Text = "Employee #1" Then Range("BS19").Value = 4 Else
If Range("BF23").Text = "Employee #1" Then Range("BS19").Value = 5 Else
If Range("BF24").Text = "Employee #1" Then Range("BS19").Value = 6 Else
If Range("BF25").Text = "Employee #1" Then Range("BS19").Value = 7 Else
If Range("BF26").Text = "Employee #1" Then Range("BS19").Value = 8 Else
If Range("BF27").Text = "Employee #1" Then Range("BS19").Value = 9 Else
'work share
If Range("BJ19").Text = "Employee #1" Then Range("BT19").Value = 1 Else
If Range("BJ20").Text = "Employee #1" Then Range("BT19").Value = 2 Else
If Range("BJ21").Text = "Employee #1" Then Range("BT19").Value = 3 Else
If Range("BJ22").Text = "Employee #1" Then Range("BT19").Value = 4 Else
If Range("BJ23").Text = "Employee #1" Then Range("BT19").Value = 5 Else
If Range("BJ24").Text = "Employee #1" Then Range("BT19").Value = 6 Else
If Range("BJ25").Text = "Employee #1" Then Range("BT19").Value = 7 Else
If Range("BJ26").Text = "Employee #1" Then Range("BT19").Value = 8 Else
If Range("BJ27").Text = "Employee #1" Then Range("BT19").Value = 9 Else
'talk time
If Range("BB36").Text = "Employee #1" Then Range("BU19").Value = 1 Else
If Range("BB37").Text = "Employee #1" Then Range("BU19").Value = 2 Else
If Range("BB38").Text = "Employee #1" Then Range("BU19").Value = 3 Else
If Range("BB39").Text = "Employee #1" Then Range("BU19").Value = 4 Else
If Range("BB40").Text = "Employee #1" Then Range("BU19").Value = 5 Else
If Range("BB41").Text = "Employee #1" Then Range("BU19").Value = 6 Else
If Range("BB42").Text = "Employee #1" Then Range("BU19").Value = 7 Else
If Range("BB43").Text = "Employee #1" Then Range("BU19").Value = 8 Else
If Range("BB44").Text = "Employee #1" Then Range("BU19").Value = 9 Else
'not ready time
If Range("BF36").Text = "Employee #1" Then Range("BV19").Value = 1 Else
If Range("BF37").Text = "Employee #1" Then Range("BV19").Value = 2 Else
If Range("BF38").Text = "Employee #1" Then Range("BV19").Value = 3 Else
If Range("BF39").Text = "Employee #1" Then Range("BV19").Value = 4 Else
If Range("BF40").Text = "Employee #1" Then Range("BV19").Value = 5 Else
If Range("BF41").Text = "Employee #1" Then Range("BV19").Value = 6 Else
If Range("BF42").Text = "Employee #1" Then Range("BV19").Value = 7 Else
If Range("BF43").Text = "Employee #1" Then Range("BV19").Value = 8 Else
If Range("BF44").Text = "Employee #1" Then Range("BV19").Value = 9 Else
'tickets created
If Range("BB53").Text = "Employee #1" Then Range("BW19").Value = 1 Else
If Range("BB54").Text = "Employee #1" Then Range("BW19").Value = 2 Else
If Range("BB55").Text = "Employee #1" Then Range("BW19").Value = 3 Else
If Range("BB56").Text = "Employee #1" Then Range("BW19").Value = 4 Else
If Range("BB57").Text = "Employee #1" Then Range("BW19").Value = 5 Else
If Range("BB58").Text = "Employee #1" Then Range("BW19").Value = 6 Else
If Range("BB59").Text = "Employee #1" Then Range("BW19").Value = 7 Else
If Range("BB60").Text = "Employee #1" Then Range("BW19").Value = 8 Else
If Range("BB61").Text = "Employee #1" Then Range("BW19").Value = 9 Else
'tickets closed
If Range("BF53").Text = "Employee #1" Then Range("BX19").Value = 1 Else
If Range("BF54").Text = "Employee #1" Then Range("BX19").Value = 2 Else
If Range("BF55").Text = "Employee #1" Then Range("BX19").Value = 3 Else
If Range("BF56").Text = "Employee #1" Then Range("BX19").Value = 4 Else
If Range("BF57").Text = "Employee #1" Then Range("BX19").Value = 5 Else
If Range("BF58").Text = "Employee #1" Then Range("BX19").Value = 6 Else
If Range("BF59").Text = "Employee #1" Then Range("BX19").Value = 7 Else
If Range("BF60").Text = "Employee #1" Then Range("BX19").Value = 8 Else
If Range("BF61").Text = "Employee #1" Then Range("BX19").Value = 9 Else
'resolution
If Range("BJ53").Text = "Employee #1" Then Range("BY19").Value = 1 Else
If Range("BJ54").Text = "Employee #1" Then Range("BY19").Value = 2 Else
If Range("BJ55").Text = "Employee #1" Then Range("BY19").Value = 3 Else
If Range("BJ56").Text = "Employee #1" Then Range("BY19").Value = 4 Else
If Range("BJ57").Text = "Employee #1" Then Range("BY19").Value = 5 Else
If Range("BJ58").Text = "Employee #1" Then Range("BY19").Value = 6 Else
If Range("BJ59").Text = "Employee #1" Then Range("BY19").Value = 7 Else
If Range("BJ60").Text = "Employee #1" Then Range("BY19").Value = 8 Else
If Range("BJ61").Text = "Employee #1" Then Range("BY19").Value = 9 Else
End Sub

Thanks for any help you can provide,
Phil





 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Compile error: Procedure too large? Jerry Dyben Excel Discussion (Misc queries) 1 October 31st 05 10:15 PM
Compile error: Procedure too large BHARATH RAJAMANI Excel Programming 2 August 24th 05 10:24 PM
Compile Error: Procedure too Large Question Daniel R. Young Excel Programming 6 July 21st 05 08:01 PM
Compile error: Procedure too large Susan Hayes Excel Programming 2 May 20th 05 05:01 PM
Compile Error: Procedure too large mate Excel Programming 2 May 18th 04 04:30 PM


All times are GMT +1. The time now is 11:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"