Thread
:
InputBox
View Single Post
#
4
Posted to microsoft.public.excel.programming
Nick Hodge
external usenet poster
Posts: 1,173
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
HIS
"Norman Jones" wrote in message
...
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" wrote in message
...
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
Reply With Quote
Nick Hodge
View Public Profile
Find all posts by Nick Hodge