That code works just fine for me. I would declare c as range though. By any
chance do you have on change, on selection change or before print code
anywhere? If so disable events at the start and procedure and re-enable at
the end...
--
HTH...
Jim Thomlinson
"Hernandez, Roberto" wrote:
> Regards:
>
> I´ve been working in the code below to 'automatize' a printing process.
> The problem I have is that I can't select a range, but only one cell!
> It works terrific in other workbooks, but fails in this.
>
> If I try it selecting a range (more than one cell), I get the message error
> "An object is required."
>
> Can anybody help, please.
>
> Thanks in advance for your support.
>
> '****************************************************************
> Sub imprimir_seleccionando()
>
> Dim seleccion As Range
>
> On Error Resume Next
> Worksheets("Diciembre").Select
>
> Application.ScreenUpdating = True
>
> Set seleccion = Application.InputBox( _
> Prompt:="Select the employee IDs", _
> Title:="Invoices to print", _
> Default:=("$B$7"), _
> Type:=8) '8 type is suposed to catch a range, doesn´t it?
>
> If seleccion Is Nothing Then
> MsgBox "It doesn´t work..."
> Exit Sub
> Else
> MsgBox "It works!!"
> Worksheets("imprimir").Select
> For Each c In seleccion
> Range("$B$8").Value = c.Value
> ActiveSheet.PrintOut
> Next c
> MsgBox "Done"
> End If
>
> End Sub
> '**************************************************************************
>
>
>
Bookmarks