#13 type mismatch error on user form for Dave Peterson

J

Janis

Dave can you check my last post. I checked through all the posts and it is
still not answered. thanks,
 
J

Janis

Dave or anyone can you tell me why there is a type 13 mismatch? it is urgent!
Private Sub UserForm_Initialize()

Dim intLastRow As Integer
Dim ws As Worksheet
Dim c As Range
Dim rng As Range
Set ws = ThisWorkbook.Worksheets("patients")


'intLastRow = ws.SpecialCells(xlCellTypeLastCell).Row
intLastRow = Cells.Find(What:="*", After:=[A1], SearchDirection:=xlPrevious)

Set rng = Worksheets("patients").Range("A1:A" & intLastRow)

'Set rng = ws.Range("A1:A" & intLastRow)
ComboBox2.Clear
For Each c In Worksheets("patients").rng
ComboBox2.AddItem c.Value
Next c

End Sub
 
B

Bob Phillips

Private Sub UserForm_Initialize()

Dim intLastRow As Integer
Dim ws As Worksheet
Dim c As Range
Dim rng As Range
Set ws = ThisWorkbook.Worksheets("patients")

'intLastRow = ws.SpecialCells(xlCellTypeLastCell).Row
intLastRow = Cells.Find(What:="*", After:=ws.Range("A1"),
SearchDirection:=xlPrevious).Row

Set rng = Worksheets("patients").Range("A1:A" & intLastRow)

'Set rng = ws.Range("A1:A" & intLastRow)
Me.ComboBox2.Clear
For Each c In rng
Me.ComboBox2.AddItem c.Value
Next c

End Sub


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



Janis said:
Dave or anyone can you tell me why there is a type 13 mismatch? it is
urgent!
Private Sub UserForm_Initialize()

Dim intLastRow As Integer
Dim ws As Worksheet
Dim c As Range
Dim rng As Range
Set ws = ThisWorkbook.Worksheets("patients")


'intLastRow = ws.SpecialCells(xlCellTypeLastCell).Row
intLastRow = Cells.Find(What:="*", After:=[A1],
SearchDirection:=xlPrevious)

Set rng = Worksheets("patients").Range("A1:A" & intLastRow)

'Set rng = ws.Range("A1:A" & intLastRow)
ComboBox2.Clear
For Each c In Worksheets("patients").rng
ComboBox2.AddItem c.Value
Next c

End Sub
Janis said:
Dave can you check my last post. I checked through all the posts and it
is
still not answered. thanks,
 
D

Dave Peterson

Check your other post.
Dave or anyone can you tell me why there is a type 13 mismatch? it is urgent!
Private Sub UserForm_Initialize()

Dim intLastRow As Integer
Dim ws As Worksheet
Dim c As Range
Dim rng As Range
Set ws = ThisWorkbook.Worksheets("patients")

'intLastRow = ws.SpecialCells(xlCellTypeLastCell).Row
intLastRow = Cells.Find(What:="*", After:=[A1], SearchDirection:=xlPrevious)

Set rng = Worksheets("patients").Range("A1:A" & intLastRow)

'Set rng = ws.Range("A1:A" & intLastRow)
ComboBox2.Clear
For Each c In Worksheets("patients").rng
ComboBox2.AddItem c.Value
Next c

End Sub
Janis said:
Dave can you check my last post. I checked through all the posts and it is
still not answered. thanks,
 
J

Janis

All I can say is thank you. I couldn't go to work without htis. I will try
in the future not to re-post for hte same probelm. the worry is after
several answers usually no one reads it anymore.

Bob Phillips said:
Private Sub UserForm_Initialize()

Dim intLastRow As Integer
Dim ws As Worksheet
Dim c As Range
Dim rng As Range
Set ws = ThisWorkbook.Worksheets("patients")

'intLastRow = ws.SpecialCells(xlCellTypeLastCell).Row
intLastRow = Cells.Find(What:="*", After:=ws.Range("A1"),
SearchDirection:=xlPrevious).Row

Set rng = Worksheets("patients").Range("A1:A" & intLastRow)

'Set rng = ws.Range("A1:A" & intLastRow)
Me.ComboBox2.Clear
For Each c In rng
Me.ComboBox2.AddItem c.Value
Next c

End Sub


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



Janis said:
Dave or anyone can you tell me why there is a type 13 mismatch? it is
urgent!
Private Sub UserForm_Initialize()

Dim intLastRow As Integer
Dim ws As Worksheet
Dim c As Range
Dim rng As Range
Set ws = ThisWorkbook.Worksheets("patients")


'intLastRow = ws.SpecialCells(xlCellTypeLastCell).Row
intLastRow = Cells.Find(What:="*", After:=[A1],
SearchDirection:=xlPrevious)

Set rng = Worksheets("patients").Range("A1:A" & intLastRow)

'Set rng = ws.Range("A1:A" & intLastRow)
ComboBox2.Clear
For Each c In Worksheets("patients").rng
ComboBox2.AddItem c.Value
Next c

End Sub
Janis said:
Dave can you check my last post. I checked through all the posts and it
is
still not answered. thanks,
 
B

Bob Phillips

You would be surprised. Most of us regulars will watch a thread that we
join.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



Janis said:
All I can say is thank you. I couldn't go to work without htis. I will
try
in the future not to re-post for hte same probelm. the worry is after
several answers usually no one reads it anymore.

Bob Phillips said:
Private Sub UserForm_Initialize()

Dim intLastRow As Integer
Dim ws As Worksheet
Dim c As Range
Dim rng As Range
Set ws = ThisWorkbook.Worksheets("patients")

'intLastRow = ws.SpecialCells(xlCellTypeLastCell).Row
intLastRow = Cells.Find(What:="*", After:=ws.Range("A1"),
SearchDirection:=xlPrevious).Row

Set rng = Worksheets("patients").Range("A1:A" & intLastRow)

'Set rng = ws.Range("A1:A" & intLastRow)
Me.ComboBox2.Clear
For Each c In rng
Me.ComboBox2.AddItem c.Value
Next c

End Sub


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



Janis said:
Dave or anyone can you tell me why there is a type 13 mismatch? it is
urgent!
Private Sub UserForm_Initialize()

Dim intLastRow As Integer
Dim ws As Worksheet
Dim c As Range
Dim rng As Range
Set ws = ThisWorkbook.Worksheets("patients")


'intLastRow = ws.SpecialCells(xlCellTypeLastCell).Row
intLastRow = Cells.Find(What:="*", After:=[A1],
SearchDirection:=xlPrevious)

Set rng = Worksheets("patients").Range("A1:A" & intLastRow)

'Set rng = ws.Range("A1:A" & intLastRow)
ComboBox2.Clear
For Each c In Worksheets("patients").rng
ComboBox2.AddItem c.Value
Next c

End Sub
:

Dave can you check my last post. I checked through all the posts and
it
is
still not answered. thanks,
 
Top