Compile error / prosedure too large

blaksnm

Well-known Member
Joined
Dec 15, 2009
Messages
554
Office Version
  1. 365
Platform
  1. Windows
Hi
I have a table with 7 x 5 rows, 6-10,12-16, 18-22, 24-28, 30-34, 36-40 and 42-46 (Total 35 rows)
For each row this procedure is made (example below is to row 46):
The procedure works fine on 34 rows (random pick), but not when I hardcode the 35th...
I am searching this forum for some guiding out of this problem - can anybody help me?

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'Modified 2/26/2020 10:33:36 PM EST
'ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:=False, AllowFormattingColumns:=True, AllowFormattingRows:=True
Application.ScreenUpdating = False

If Not Intersect(Target, Range("B46")) Is Nothing Then
Cancel = True
Range("B46").Value = Range("B4").Value + 1
Range("C46").Select
End If

If Not Intersect(Target, Range("C46")) Is Nothing Then
Cancel = True
Range("B46:B46").ClearContents
Range("B46").Value = Range("B4").Value + 1
Range("C46").Copy
Sheets("Fordeling").Range("FordelingKodeSubArea") = Sheets("Reg").Range("C46") 'value'PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
ArbeidsArtListe
Range("E46").Value = Sheets("Fordeling").Range("FordelingKopiStart").Value
Range("E46").Select
Range("J46").Value = "Ferdig"
Range("L46").Value = Time
End If

If Not Intersect(Target, Range("J46")) Is Nothing Then
Cancel = True
Range("J46").Value = "Ferdig"
Range("M46").Value = Time
Range("M46").Select

End If

If Not Intersect(Target, Range("K46")) Is Nothing Then
Cancel = True
KjøreListeReg
End If

If Not Intersect(Target, Range("L46")) Is Nothing Then
Cancel = True
ActiveCell.Value = Time
Range("L46").Select
End If

If Not Intersect(Target, Range("M46")) Is Nothing Then
Cancel = True
ActiveCell.Value = Time
Range("M46").Select
End If
Application.ScreenUpdating = True
End Sub
 
This should work
VBA Code:
Range("L" & Rw + 1).Value=Range("M"&Rw).Value
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Glad you sorted it & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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