Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I believe the problem is with the InputBox IndxNum and the Variant c.
The IndxNum in this case is a number and the For Each c requires a Variant. Seems they not be compatible. Also, have not got far enough to test it, but will the next MyStringVariable be listed below the previous or do I need the & vbCr at the end of MyStringVariable? I have Multi Line = TRUE in properties. Thanks, Howard Option Explicit Sub TheT_Box() Dim MyStringVariable As String Dim IndxNum As Long Dim IndexCol As Range Dim c As Variant Set IndexCol = Range("A2:A7") IndxNum = Application.InputBox(Prompt:="Enter an Number.", _ Title:="Enter Index Number", Type:=1) ' 1 = number If IndxNum = "" Or IndxNum = "False" Then Exit Sub For Each c In Range("IndexCol") 'Range("A2:A7") If c.Value = IndxNum Then MyStringVariable = c.Offset(0, 4).Value & ", " & c.Offset(0, 1).Value _ & c.Offset(0, 2).Value & ", " & c.Offset(0, 14).Value _ & ", " & c.Offset(0, 15).Value & ", " & c.Offset(0, 18).Value '& vbCr TextBox1.Text = MyStringVariable End If Next ' c End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
http://CannotDeleteFile.net - Cannot Delete File? Try Long Path ToolFilename is too long? Computer Complaining Your Filename Is Too Long? TheLong Path Tool Can Help While most people can go about their businessblissfully unaware of the Windo | Excel Discussion (Misc queries) | |||
Long Long Long Nested If Function | Excel Discussion (Misc queries) | |||
Using created variant value to reference to a variant within my code | Excel Programming | |||
Clearing cells takes long, long time | Excel Discussion (Misc queries) | |||
variant to long? | Excel Programming |