+ Reply to Thread
Results 1 to 8 of 8

InputBox

  1. #1
    smandula
    Guest

    InputBox

    How do you move the InputBox to the Top Right of the screen?

    Sub testme99()

    Dim myColA As Range
    Dim myColB As Range
    Dim myCell As Range
    Dim myMaster As Range
    Dim mySub As Range
    Dim res As Variant

    On Error Resume Next
    Set myColA = Application.InputBox("select first Range", _ **
    Top:= ? Left:= ? **
    Default:=Selection.Address, Title:="Select", Type:=8)
    On Error GoTo 0

    If myColA Is Nothing Then Exit Sub

    On Error Resume Next
    Set myColB = Application.InputBox("select 2nd range", Type:=8) ** Top:=
    ? Left:= ? **

    On Error GoTo 0

    If myColB Is Nothing Then Exit Sub

    If myColA.Cells.Count > myColB.Cells.Count Then
    Set myMaster = myColB
    Set mySub = myColA
    Else
    Set myMaster = myColA
    Set mySub = myColB
    End If

    'loop through smaller range
    For Each myCell In myMaster.Cells
    res = Application.Match(myCell.Value, mySub, 0)
    If IsError(res) Then
    'no match
    Else
    myCell.Interior.ColorIndex = 6
    mySub(res).Interior.ColorIndex = 6
    End If
    Next myCell

    End Sub

    With Thanks



  2. #2
    Nick Hodge
    Guest

    Re: InputBox

    Depends on the size of the screen/resolution. You will need to experiment,
    it is a number in points (1/72th inch)

    Try... and see how you get on

    Top:= 10
    Left:= 800

    It's not an exact science and will vary on different screens/resolutions

    --
    HTH
    Nick Hodge
    Microsoft MVP - Excel
    Southampton, England
    [email protected]HIS


    "smandula" <[email protected]> wrote in message
    news:[email protected]...
    > How do you move the InputBox to the Top Right of the screen?
    >
    > Sub testme99()
    >
    > Dim myColA As Range
    > Dim myColB As Range
    > Dim myCell As Range
    > Dim myMaster As Range
    > Dim mySub As Range
    > Dim res As Variant
    >
    > On Error Resume Next
    > Set myColA = Application.InputBox("select first Range", _ **
    > Top:= ? Left:= ? **
    > Default:=Selection.Address, Title:="Select", Type:=8)
    > On Error GoTo 0
    >
    > If myColA Is Nothing Then Exit Sub
    >
    > On Error Resume Next
    > Set myColB = Application.InputBox("select 2nd range", Type:=8) **
    > Top:= ? Left:= ? **
    >
    > On Error GoTo 0
    >
    > If myColB Is Nothing Then Exit Sub
    >
    > If myColA.Cells.Count > myColB.Cells.Count Then
    > Set myMaster = myColB
    > Set mySub = myColA
    > Else
    > Set myMaster = myColA
    > Set mySub = myColB
    > End If
    >
    > 'loop through smaller range
    > For Each myCell In myMaster.Cells
    > res = Application.Match(myCell.Value, mySub, 0)
    > If IsError(res) Then
    > 'no match
    > Else
    > myCell.Interior.ColorIndex = 6
    > mySub(res).Interior.ColorIndex = 6
    > End If
    > Next myCell
    >
    > End Sub
    >
    > With Thanks
    >




  3. #3
    Norman Jones
    Guest

    Re: InputBox

    Hi Smandula,

    Look at VBA help on the InputBox Function.

    The function includes optional xpos and ypos parameters which allow the
    postioning of the inputbox.


    ---
    Regards,
    Norman



    "smandula" <[email protected]> wrote in message
    news:[email protected]...
    > How do you move the InputBox to the Top Right of the screen?
    >
    > Sub testme99()
    >
    > Dim myColA As Range
    > Dim myColB As Range
    > Dim myCell As Range
    > Dim myMaster As Range
    > Dim mySub As Range
    > Dim res As Variant
    >
    > On Error Resume Next
    > Set myColA = Application.InputBox("select first Range", _ **
    > Top:= ? Left:= ? **
    > Default:=Selection.Address, Title:="Select", Type:=8)
    > On Error GoTo 0
    >
    > If myColA Is Nothing Then Exit Sub
    >
    > On Error Resume Next
    > Set myColB = Application.InputBox("select 2nd range", Type:=8) **
    > Top:= ? Left:= ? **
    >
    > On Error GoTo 0
    >
    > If myColB Is Nothing Then Exit Sub
    >
    > If myColA.Cells.Count > myColB.Cells.Count Then
    > Set myMaster = myColB
    > Set mySub = myColA
    > Else
    > Set myMaster = myColA
    > Set mySub = myColB
    > End If
    >
    > 'loop through smaller range
    > For Each myCell In myMaster.Cells
    > res = Application.Match(myCell.Value, mySub, 0)
    > If IsError(res) Then
    > 'no match
    > Else
    > myCell.Interior.ColorIndex = 6
    > mySub(res).Interior.ColorIndex = 6
    > End If
    > Next myCell
    >
    > End Sub
    >
    > With Thanks
    >




  4. #4
    Nick Hodge
    Guest

    Re: InputBox

    Norman

    The OP was using XLs version

    Application.InputBox

    not VBA's

    Inputbox

    The former's properties are Left and Top

    (Same thing really, except VBA's uses twips and Excel's uses points)

    --
    HTH
    Nick Hodge
    Microsoft MVP - Excel
    Southampton, England
    [email protected]HIS


    "Norman Jones" <[email protected]> wrote in message
    news:[email protected]...
    > Hi Smandula,
    >
    > Look at VBA help on the InputBox Function.
    >
    > The function includes optional xpos and ypos parameters which allow the
    > postioning of the inputbox.
    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    >
    > "smandula" <[email protected]> wrote in message
    > news:[email protected]...
    >> How do you move the InputBox to the Top Right of the screen?
    >>
    >> Sub testme99()
    >>
    >> Dim myColA As Range
    >> Dim myColB As Range
    >> Dim myCell As Range
    >> Dim myMaster As Range
    >> Dim mySub As Range
    >> Dim res As Variant
    >>
    >> On Error Resume Next
    >> Set myColA = Application.InputBox("select first Range", _ **
    >> Top:= ? Left:= ? **
    >> Default:=Selection.Address, Title:="Select", Type:=8)
    >> On Error GoTo 0
    >>
    >> If myColA Is Nothing Then Exit Sub
    >>
    >> On Error Resume Next
    >> Set myColB = Application.InputBox("select 2nd range", Type:=8) **
    >> Top:= ? Left:= ? **
    >>
    >> On Error GoTo 0
    >>
    >> If myColB Is Nothing Then Exit Sub
    >>
    >> If myColA.Cells.Count > myColB.Cells.Count Then
    >> Set myMaster = myColB
    >> Set mySub = myColA
    >> Else
    >> Set myMaster = myColA
    >> Set mySub = myColB
    >> End If
    >>
    >> 'loop through smaller range
    >> For Each myCell In myMaster.Cells
    >> res = Application.Match(myCell.Value, mySub, 0)
    >> If IsError(res) Then
    >> 'no match
    >> Else
    >> myCell.Interior.ColorIndex = 6
    >> mySub(res).Interior.ColorIndex = 6
    >> End If
    >> Next myCell
    >>
    >> End Sub
    >>
    >> With Thanks
    >>

    >
    >




  5. #5
    Norman Jones
    Guest

    Re: InputBox

    Hi Nick,

    > The OP was using XLs version
    >
    > Application.InputBox


    Yes, I mis-read. Apologies to Smandula.


    Thank you for the necessary correction.

    ---
    Regards,
    Norman



    "Nick Hodge" <[email protected]> wrote in message
    news:%[email protected]...
    > Norman
    >
    > The OP was using XLs version
    >
    > Application.InputBox
    >
    > not VBA's
    >
    > Inputbox
    >
    > The former's properties are Left and Top
    >
    > (Same thing really, except VBA's uses twips and Excel's uses points)
    >
    > --
    > HTH
    > Nick Hodge
    > Microsoft MVP - Excel
    > Southampton, England
    > [email protected]HIS
    >
    >
    > "Norman Jones" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hi Smandula,
    >>
    >> Look at VBA help on the InputBox Function.
    >>
    >> The function includes optional xpos and ypos parameters which allow the
    >> postioning of the inputbox.
    >>
    >>
    >> ---
    >> Regards,
    >> Norman
    >>
    >>
    >>
    >> "smandula" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> How do you move the InputBox to the Top Right of the screen?
    >>>
    >>> Sub testme99()
    >>>
    >>> Dim myColA As Range
    >>> Dim myColB As Range
    >>> Dim myCell As Range
    >>> Dim myMaster As Range
    >>> Dim mySub As Range
    >>> Dim res As Variant
    >>>
    >>> On Error Resume Next
    >>> Set myColA = Application.InputBox("select first Range", _ **
    >>> Top:= ? Left:= ? **
    >>> Default:=Selection.Address, Title:="Select", Type:=8)
    >>> On Error GoTo 0
    >>>
    >>> If myColA Is Nothing Then Exit Sub
    >>>
    >>> On Error Resume Next
    >>> Set myColB = Application.InputBox("select 2nd range", Type:=8) **
    >>> Top:= ? Left:= ? **
    >>>
    >>> On Error GoTo 0
    >>>
    >>> If myColB Is Nothing Then Exit Sub
    >>>
    >>> If myColA.Cells.Count > myColB.Cells.Count Then
    >>> Set myMaster = myColB
    >>> Set mySub = myColA
    >>> Else
    >>> Set myMaster = myColA
    >>> Set mySub = myColB
    >>> End If
    >>>
    >>> 'loop through smaller range
    >>> For Each myCell In myMaster.Cells
    >>> res = Application.Match(myCell.Value, mySub, 0)
    >>> If IsError(res) Then
    >>> 'no match
    >>> Else
    >>> myCell.Interior.ColorIndex = 6
    >>> mySub(res).Interior.ColorIndex = 6
    >>> End If
    >>> Next myCell
    >>>
    >>> End Sub
    >>>
    >>> With Thanks
    >>>

    >>
    >>

    >
    >




  6. #6
    smandula
    Guest

    Re: InputBox


    I tried the method below
    Top:= 10
    Left:= 800
    and it did not work.

    That was prior to my posting. Now,
    that I posted it works. Go figure.

    Thanks everyone for all your replies.




  7. #7
    Nick Hodge
    Guest

    Re: InputBox

    Norman and I have powerful thought processes to cause this ;-)

    --
    HTH
    Nick Hodge
    Microsoft MVP - Excel
    Southampton, England
    [email protected]HIS


    "smandula" <[email protected]> wrote in message
    news:[email protected]...
    >
    > I tried the method below
    > Top:= 10
    > Left:= 800
    > and it did not work.
    >
    > That was prior to my posting. Now,
    > that I posted it works. Go figure.
    >
    > Thanks everyone for all your replies.
    >
    >
    >




  8. #8
    Norman Jones
    Guest

    Re: InputBox

    Hi Nick,

    Would that all problems were susceptible of similar auto-resolution!

    ---
    Regards,
    Norman



    "Nick Hodge" <[email protected]> wrote in message
    news:[email protected]...
    > Norman and I have powerful thought processes to cause this ;-)
    >
    > --
    > HTH
    > Nick Hodge
    > Microsoft MVP - Excel
    > Southampton, England
    > [email protected]HIS
    >
    >
    > "smandula" <[email protected]> wrote in message
    > news:[email protected]...
    >>
    >> I tried the method below
    >> Top:= 10
    >> Left:= 800
    >> and it did not work.
    >>
    >> That was prior to my posting. Now,
    >> that I posted it works. Go figure.
    >>
    >> Thanks everyone for all your replies.
    >>
    >>
    >>

    >
    >




+ 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