Thank you so very much for your time and support.
This code is in a 'normal' module, and absolutely there is no more code in
whole book.
I belive you when you say it works for you, because works for me in other
books.
Anyhow, i'll keep trying...
Maybe re-starting from a blank book.
Thanks again!!
"Jim Thomlinson" <jamest@tcgiRe-Move-This.com> escribió en el mensaje
news:8064A5B6-3AF2-49FD-A0ED-6B898A5BB5A0@microsoft.com...
> 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