Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I think Chip misspoke, er, mistyped. It works ok for me.
Chip Pearson wrote: The Cells property does not support a SpecialCells property. intLastRow = ws.Cells.SpecialCells(xlCellTypeLastCell).Row to intLastRow = ws.SpecialCells(xlCellTypeLastCell).Row -- Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2008 Pearson Software Consulting, LLC www.cpearson.com (email on web site) "Janis" wrote in message ... it can't compile, It appears to be the ws as object declaration. How do I declare ws? 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.Cells.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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA error: "object doesn't support this property or method" | Excel Discussion (Misc queries) | |||
object reference does not support this property or method | Excel Discussion (Misc queries) | |||
ddm enable/disable: Object doesn't support this property, my a** it doesn't | Excel Discussion (Misc queries) | |||
runtime error 1004 method range of object '_global failed | Excel Discussion (Misc queries) | |||
Object doesn't support this property or method (Error 438) | Excel Discussion (Misc queries) |