Hello,, I have a syntax error in [YELLOW LINE]
Sub Rectángulo4_Haga_clic_en()
Dim Rango As Range
Dim Celda As Range
Dim Lista As Range
Set Rango = Worksheets("Print").Range("B2:B24")
Set Lista = Evaluate(Rango.Validation.Formula1) <--- THIS IS YELLOW LINE
For Each Celda In Lista
Rango = Celda.Value
ActiveSheet.PrintOut
Next
End Sub
My goal is to take each line from pic 2, put it in five places in pic 1, and print, as much as there are rows in pic 2.
Please help
Thank you
I solved it by this,, and would appreciate a simplyfing ideas for a beginner, thank you.
Sub PrintAll()
'thank you sir for your order
'I have started this from scratch, to serve you ASAP
'First thing I want to know how many times are in my loop and I need a reference value in A2
Sheets("Data").Select
Range("H1").FormulaR1C1 = "=LOOKUP(2,1/(C[-7]<>""""),C[-7])"
Range("A2").FormulaR1C1 = "ref"
' Now let us start our loop, defining a very useful and simple (i)
' I know this can be factorized,, but it is working,, and super fast
' we find title row, offset no navigate, upon our (I)
' and let's copy, paste, and pring each (i)
For I = 1 To Range("H1").Value
Sheets("Data").Select
Range("A1").Select
Selection.End(xlDown).Select
Selection.Offset(I, 0).Select
Selection.Offset(0, 1).Copy
Sheets("Print").Select
Range("B2:B13").Select
ActiveSheet.Paste
Sheets("Data").Select
Range("A1").Select
Selection.End(xlDown).Select
Selection.Offset(I, 0).Select
Selection.Offset(0, 2).Copy
Sheets("Print").Select
Range("B24:B38").Select
ActiveSheet.Paste
Sheets("Data").Select
Range("A1").Select
Selection.End(xlDown).Select
Selection.Offset(I, 0).Select
Selection.Offset(0, 3).Copy
Sheets("Print").Select
Range("B41:B50").Select
ActiveSheet.Paste
Sheets("Data").Select
Range("A1").Select
Selection.End(xlDown).Select
Selection.Offset(I, 0).Select
Selection.Offset(0, 4).Copy
Sheets("Print").Select
Range("B59:B77").Select
ActiveSheet.Paste
Sheets("Data").Select
Range("A1").Select
Selection.End(xlDown).Select
Selection.Offset(I, 0).Select
Selection.Offset(0, 5).Copy
Sheets("Print").Select
Range("B84:B95").Select
ActiveSheet.Paste
ActiveSheet.PrintOut
Next I
' finally, let's notify completion.
MsgBox "All Printed"
End Sub