Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 360
Default error message 438 or type mismatch

I get an error message 438 if I use the 2nd intLastRow line, I get a type
mismatch 13 if I use the 1st intLastJRow line. In either case it doesnt'
compile. I was thinking it was something wrong with the setting of the ws
variable but I dont' know which intlastrow it should be. I only want all the
names in row "A" to be in the combo box list. I'm having trouble with
setting the rng and ws variables.
tnx,

Private Sub UserForm_Initialize()

Dim intLastRow As Integer
Dim ws As Object
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 = ws.Range("A1:A" & intLastRow)
ComboBox2.Clear
For Each c In Worksheets("patients").rng
ComboBox2.AddItem c.Value
Next c

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default error message 438 or type mismatch

Check your previous posts.

If you keep starting new threads instead of following up on the old ones, you
may find that lots of people ignore your posts.

Janis wrote:

I get an error message 438 if I use the 2nd intLastRow line, I get a type
mismatch 13 if I use the 1st intLastJRow line. In either case it doesnt'
compile. I was thinking it was something wrong with the setting of the ws
variable but I dont' know which intlastrow it should be. I only want all the
names in row "A" to be in the combo box list. I'm having trouble with
setting the rng and ws variables.
tnx,

Private Sub UserForm_Initialize()

Dim intLastRow As Integer
Dim ws As Object
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 = ws.Range("A1:A" & intLastRow)
ComboBox2.Clear
For Each c In Worksheets("patients").rng
ComboBox2.AddItem c.Value
Next c

End Sub


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 360
Default error message 438 or type mismatch

dave sorry, i got lost on the previous posts so I started a new one because
it was hard to follow the changes. I will reread them all. please dont'
ignore me.

"Dave Peterson" wrote:

Check your previous posts.

If you keep starting new threads instead of following up on the old ones, you
may find that lots of people ignore your posts.

Janis wrote:

I get an error message 438 if I use the 2nd intLastRow line, I get a type
mismatch 13 if I use the 1st intLastJRow line. In either case it doesnt'
compile. I was thinking it was something wrong with the setting of the ws
variable but I dont' know which intlastrow it should be. I only want all the
names in row "A" to be in the combo box list. I'm having trouble with
setting the rng and ws variables.
tnx,

Private Sub UserForm_Initialize()

Dim intLastRow As Integer
Dim ws As Object
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 = ws.Range("A1:A" & intLastRow)
ComboBox2.Clear
For Each c In Worksheets("patients").rng
ComboBox2.AddItem c.Value
Next c

End Sub


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 360
Default error message 438 or type mismatch

Dave
I went through all the posts about the subject and I tailored as nearly as
possible to what was said. I am still getting a type 13 mismatch. There is
one thing that is still not correct and from the posts I cannot tell which is
the right answer. It stops at intLastRow.
If some one gave the right answer then I didn't know which one was right
and which was wrong. can you help me with the type 13
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 Peterson" wrote:

Check your previous posts.

If you keep starting new threads instead of following up on the old ones, you
may find that lots of people ignore your posts.

Janis wrote:

I get an error message 438 if I use the 2nd intLastRow line, I get a type
mismatch 13 if I use the 1st intLastJRow line. In either case it doesnt'
compile. I was thinking it was something wrong with the setting of the ws
variable but I dont' know which intlastrow it should be. I only want all the
names in row "A" to be in the combo box list. I'm having trouble with
setting the rng and ws variables.
tnx,

Private Sub UserForm_Initialize()

Dim intLastRow As Integer
Dim ws As Object
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 = ws.Range("A1:A" & intLastRow)
ComboBox2.Clear
For Each c In Worksheets("patients").rng
ComboBox2.AddItem c.Value
Next c

End Sub


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default error message 438 or type mismatch

What line causes the error?

and you didn't change
Dim intLastRow as long
For Each c In rng.cells

And maybe:

with ws
intLastRow = .Cells.Find(What:="*", After:=.range("a1")], _
SearchDirection:=xlPrevious)
end with


Janis wrote:

Dave
I went through all the posts about the subject and I tailored as nearly as
possible to what was said. I am still getting a type 13 mismatch. There is
one thing that is still not correct and from the posts I cannot tell which is
the right answer. It stops at intLastRow.
If some one gave the right answer then I didn't know which one was right
and which was wrong. can you help me with the type 13
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 Peterson" wrote:

Check your previous posts.

If you keep starting new threads instead of following up on the old ones, you
may find that lots of people ignore your posts.

Janis wrote:

I get an error message 438 if I use the 2nd intLastRow line, I get a type
mismatch 13 if I use the 1st intLastJRow line. In either case it doesnt'
compile. I was thinking it was something wrong with the setting of the ws
variable but I dont' know which intlastrow it should be. I only want all the
names in row "A" to be in the combo box list. I'm having trouble with
setting the rng and ws variables.
tnx,

Private Sub UserForm_Initialize()

Dim intLastRow As Integer
Dim ws As Object
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 = ws.Range("A1:A" & intLastRow)
ComboBox2.Clear
For Each c In Worksheets("patients").rng
ComboBox2.AddItem c.Value
Next c

End Sub


--

Dave Peterson


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default error message 438 or type mismatch

I didn't remove the closing bracket:

with ws
intLastRow = .Cells.Find(What:="*", After:=.range("a1"), _
SearchDirection:=xlPrevious)
end with

Dave Peterson wrote:

What line causes the error?

and you didn't change
Dim intLastRow as long
For Each c In rng.cells

And maybe:

with ws
intLastRow = .Cells.Find(What:="*", After:=.range("a1")], _
SearchDirection:=xlPrevious)
end with

Janis wrote:

Dave
I went through all the posts about the subject and I tailored as nearly as
possible to what was said. I am still getting a type 13 mismatch. There is
one thing that is still not correct and from the posts I cannot tell which is
the right answer. It stops at intLastRow.
If some one gave the right answer then I didn't know which one was right
and which was wrong. can you help me with the type 13
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 Peterson" wrote:

Check your previous posts.

If you keep starting new threads instead of following up on the old ones, you
may find that lots of people ignore your posts.

Janis wrote:

I get an error message 438 if I use the 2nd intLastRow line, I get a type
mismatch 13 if I use the 1st intLastJRow line. In either case it doesnt'
compile. I was thinking it was something wrong with the setting of the ws
variable but I dont' know which intlastrow it should be. I only want all the
names in row "A" to be in the combo box list. I'm having trouble with
setting the rng and ws variables.
tnx,

Private Sub UserForm_Initialize()

Dim intLastRow As Integer
Dim ws As Object
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 = ws.Range("A1:A" & intLastRow)
ComboBox2.Clear
For Each c In Worksheets("patients").rng
ComboBox2.AddItem c.Value
Next c

End Sub


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
xpath error? Runtime Error 13 type mismatch Steve M[_2_] Excel Discussion (Misc queries) 0 January 17th 08 01:16 AM
xpath error? Runtime Error 13 type mismatch SteveM Excel Discussion (Misc queries) 1 December 4th 07 09:16 AM
Type Mismatch Error - Help Please Launchnet Excel Worksheet Functions 5 July 20th 07 04:35 AM
Type Mismatch Error David Excel Discussion (Misc queries) 2 December 11th 05 04:46 PM
Why type mismatch - R/T error 13 Jim May Excel Discussion (Misc queries) 5 January 9th 05 06:45 PM


All times are GMT +1. The time now is 01:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"