+ Reply to Thread
Results 1 to 8 of 8

Problems with Application.Inputbox

Hybrid View

  1. #1
    Hernandez, Roberto
    Guest

    Re: Problems with Application.Inputbox


    "Jim Thomlinson" <jamest@tcgiRe-Move-This.com> escribió en el mensaje
    news:12EDCD18-B79A-45EE-9811-FE0F78CE1981@microsoft.com...
    > What line is it erroring out on...
    > --
    > HTH...
    >

    '****************************************************************
    ...
    ...
    ...

    Application.ScreenUpdating = True

    Set seleccion = Application.InputBox( _ '<==== Right Here: "An object is
    requiered", when selecting more than one cell.
    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?
    ...
    ...

    Worksheet "Diciembre" used to have conditional formatting, but it's 'clean'
    now.

    What could it be?



  2. #2
    Jim Thomlinson
    Guest

    Re: Problems with Application.Inputbox

    Avoid the select statements. It is hard for me to tell but give this a try...

    Sub imprimir_seleccionando()

    Dim seleccion As Range
    dim wksDiciembre as worksheet
    dim wksImprimir as worksheet

    set wksDiciembre = Worksheets("Diciembre")
    set wksImprimir = Worksheets("imprimir")

    wksDiciembre .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 not seleccion Is Nothing Then
    MsgBox "It works!!"
    For Each c In seleccion
    wksImprimir.Range("$B$8").Value = c.Value
    wksImprimir.PrintOut
    Next c
    MsgBox "Done"
    Else
    MsgBox "It doesn´t work..."
    End If

    End Sub

    There is nothing in your old code that should clear any formatting or such.
    --
    HTH...

    Jim Thomlinson


    "Hernandez, Roberto" wrote:

    >
    > "Jim Thomlinson" <jamest@tcgiRe-Move-This.com> escribió en el mensaje
    > news:12EDCD18-B79A-45EE-9811-FE0F78CE1981@microsoft.com...
    > > What line is it erroring out on...
    > > --
    > > HTH...
    > >

    > '****************************************************************
    > ...
    > ...
    > ...
    >
    > Application.ScreenUpdating = True
    >
    > Set seleccion = Application.InputBox( _ '<==== Right Here: "An object is
    > requiered", when selecting more than one cell.
    > 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?
    > ...
    > ...
    >
    > Worksheet "Diciembre" used to have conditional formatting, but it's 'clean'
    > now.
    >
    > What could it be?
    >
    >
    >


  3. #3
    Hernandez, Roberto
    Guest

    Re: Problems with Application.Inputbox

    Thank you so much Jim!
    I ment I clear by hand the conditional formatting so I could solve the
    problem.
    Anyway, your code works fine.

    I'll forget this misterious passage of my 'Excel-VBA' life...
    And use your solution.

    Regards.

    "Jim Thomlinson" <jamest@tcgiRe-Move-This.com> escribió en el mensaje
    news:44E9D049-8EBF-4347-8DC9-F7E9028D1CE6@microsoft.com...
    > Avoid the select statements. It is hard for me to tell but give this a
    > try...
    >
    > Sub imprimir_seleccionando()
    >
    > Dim seleccion As Range
    > dim wksDiciembre as worksheet
    > dim wksImprimir as worksheet
    >
    > set wksDiciembre = Worksheets("Diciembre")
    > set wksImprimir = Worksheets("imprimir")
    >
    > wksDiciembre .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 not seleccion Is Nothing Then
    > MsgBox "It works!!"
    > For Each c In seleccion
    > wksImprimir.Range("$B$8").Value = c.Value
    > wksImprimir.PrintOut
    > Next c
    > MsgBox "Done"
    > Else
    > MsgBox "It doesn´t work..."
    > End If
    >
    > End Sub
    >
    > There is nothing in your old code that should clear any formatting or
    > such.
    > --
    > HTH...
    >
    > Jim Thomlinson
    >
    >
    > "Hernandez, Roberto" wrote:
    >
    >>
    >> "Jim Thomlinson" <jamest@tcgiRe-Move-This.com> escribió en el mensaje
    >> news:12EDCD18-B79A-45EE-9811-FE0F78CE1981@microsoft.com...
    >> > What line is it erroring out on...
    >> > --
    >> > HTH...
    >> >

    >> '****************************************************************
    >> ...
    >> ...
    >> ...
    >>
    >> Application.ScreenUpdating = True
    >>
    >> Set seleccion = Application.InputBox( _ '<==== Right Here: "An object is
    >> requiered", when selecting more than one cell.
    >> 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?
    >> ...
    >> ...
    >>
    >> Worksheet "Diciembre" used to have conditional formatting, but it's
    >> 'clean'
    >> now.
    >>
    >> What could it be?
    >>
    >>
    >>




  4. #4
    Jim Thomlinson
    Guest

    Re: Problems with Application.Inputbox

    Never forget. You figured out a perfectly good way how not to do something.
    That is very valuable information. At least as valuable as how to do it right.
    --
    HTH...

    Jim Thomlinson


    "Hernandez, Roberto" wrote:

    > Thank you so much Jim!
    > I ment I clear by hand the conditional formatting so I could solve the
    > problem.
    > Anyway, your code works fine.
    >
    > I'll forget this misterious passage of my 'Excel-VBA' life...
    > And use your solution.
    >
    > Regards.
    >
    > "Jim Thomlinson" <jamest@tcgiRe-Move-This.com> escribió en el mensaje
    > news:44E9D049-8EBF-4347-8DC9-F7E9028D1CE6@microsoft.com...
    > > Avoid the select statements. It is hard for me to tell but give this a
    > > try...
    > >
    > > Sub imprimir_seleccionando()
    > >
    > > Dim seleccion As Range
    > > dim wksDiciembre as worksheet
    > > dim wksImprimir as worksheet
    > >
    > > set wksDiciembre = Worksheets("Diciembre")
    > > set wksImprimir = Worksheets("imprimir")
    > >
    > > wksDiciembre .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 not seleccion Is Nothing Then
    > > MsgBox "It works!!"
    > > For Each c In seleccion
    > > wksImprimir.Range("$B$8").Value = c.Value
    > > wksImprimir.PrintOut
    > > Next c
    > > MsgBox "Done"
    > > Else
    > > MsgBox "It doesn´t work..."
    > > End If
    > >
    > > End Sub
    > >
    > > There is nothing in your old code that should clear any formatting or
    > > such.
    > > --
    > > HTH...
    > >
    > > Jim Thomlinson
    > >
    > >
    > > "Hernandez, Roberto" wrote:
    > >
    > >>
    > >> "Jim Thomlinson" <jamest@tcgiRe-Move-This.com> escribió en el mensaje
    > >> news:12EDCD18-B79A-45EE-9811-FE0F78CE1981@microsoft.com...
    > >> > What line is it erroring out on...
    > >> > --
    > >> > HTH...
    > >> >
    > >> '****************************************************************
    > >> ...
    > >> ...
    > >> ...
    > >>
    > >> Application.ScreenUpdating = True
    > >>
    > >> Set seleccion = Application.InputBox( _ '<==== Right Here: "An object is
    > >> requiered", when selecting more than one cell.
    > >> 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?
    > >> ...
    > >> ...
    > >>
    > >> Worksheet "Diciembre" used to have conditional formatting, but it's
    > >> 'clean'
    > >> now.
    > >>
    > >> What could it be?
    > >>
    > >>
    > >>

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1