Sub or Function not defined error???

perezpa

New Member
Joined
Jun 17, 2011
Messages
17
Let's play Where's Waldo! Except that in this case, Waldo is the line that is giving me an error! I can't find it! Can you?

Code:
Option Explicit

Sub La_Joa()


Dim Centro As Range
Dim resumen As Worksheet
Dim Agregado As Worksheet
Dim rngCell As Range
Dim i As Integer

'Range("A1:F55").AdvancedFilter Action:=xlFilterInPlace, Unique:=True

'Columns("G:G").Delete Shift:=xlToLeft
'Columns("K:P").Delete Shift:=xlToLeft

Set resumen = Worksheets("Resumen")
Set Agregado = Worksheets("Agregado")
    
For Each rngCell In Range("Center")

    For i = 1 To 50
        If Cell(i, 3).Value2 = "600" Then
            Cell(i, 3).Select
            Range(Selection, Selection.End(xlToRight)).Select
            Range(Selection, Selection.End(xlUp)).Copy
        End If
    Next
    Agregado.Range("tbPro[PosID]").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False

Next rngCell


End Sub

Compile Error: Sub or Function not defined.


Thank you in advance!
 
I'm still trying to wrap my head around
Code:
   Cell(i, 3).Select
   Range(Selection, Selection.End(xlToRight)).Select
   Range(Selection, Selection.End(xlUp)).Copy

I've read it multiple times and I honestly cannot say for sure what will end up being selected to copy...
Like p45cal already said: probably this code is not doing what you expect it to do... and if it does, you are expecting some weird stuff :biggrin:
 
Upvote 0

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,224,591
Messages
6,179,768
Members
452,940
Latest member
rootytrip

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