Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi there again, I always get this error everytime i run my program: "Run time error '1004': Unable to get the FInd property of the Range class" i'm using forms which includes the ff: txtsupplierpath = textBox txtquartersource= textBox cmbsupplier = ComboBox btnload = Button btnloadsource = Button opt1st = OptionButton after i press on the optionbutton, i got the error, here, i'm using 3 workbooks, i'm not sure where my error is. Also, after the first value is found, want to search the rest of the column for another value and place it i another cell, lets say under the first one... need some assistance... these are my codes: Private Sub PopulateSupplier() Dim i As Integer i = 2 Application.ScreenUpdating = False Workbooks.Open (txtSupplierPath.Value) txtSupplierPath.Value = ActiveWorkbook.Name ThisWorkbook.Activate cmbSuppliers.Clear Do With Application.Workbooks(txtSupplierPath.Value).Sheet s(2) cmbSuppliers.AddItem (.Cells(i, 2)) If .Cells(i, 2).Value = "" Then Exit Do End If i = i + 1 End With Loop Application.ScreenUpdating = True On Error Resume Next End Sub Private Sub btnLoad_Click() filetoopen = Application.GetOpenFilename("Excel Files (*.xls) *.xls") If filetoopen < False Then txtSupplierPath.Value = filetoopen PopulateSupplier End If End Sub Private Sub btnloadsource_Click() Filesource = Application.GetOpenFilename("Excel Files (*.xls) *.xls") If Filesource < False Then Application.ScreenUpdating = False txtQuarterSource.Value = Filesource Workbooks.Open (txtQuarterSource.Value) txtQuarterSource.Value = ActiveWorkbook.Name ThisWorkbook.Activate Application.ScreenUpdating = True End If End Sub Private Sub cmbSuppliers_Change() If cmbSuppliers.ListIndex -1 Then Sheet1.PopulateFields (cmbSuppliers.ListIndex + 2) Sheet2.PopulateFields (cmbSuppliers.ListIndex + 2) Sheet3.PopulateFields (cmbSuppliers.ListIndex + 2) Sheet4.PopulateFields (cmbSuppliers.ListIndex + 2) End If On Error Resume Next End Sub Private Sub Opt1st_Click() Dim wbdest As Workbook Dim wbsource As Workbook Dim lVal As String Dim fRng As Range Set wbdest = ActiveWorkbook Set wbsource = Workbooks(txtQuarterSource.Value) lVal = cmbSuppliers.Value With wbsource.Sheets(2).Columns(2) SET FRNG = .FIND(LVAL) 'ERROR IN HER If Not fRng Is Nothing Then wbdest.Sheets(2).Range("Q33").Value = _ fRng.Offset(0, 2).Value End If End With End Sub Private Sub UserForm_Activate() If txtSupplierPath.Value < "" Then PopulateSupplier End If On Error Resume Next End Sub thanks, je -- je ----------------------------------------------------------------------- jet's Profile: http://www.excelforum.com/member.php...fo&userid=2746 View this thread: http://www.excelforum.com/showthread.php?threadid=46979 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Finding a Workbook based on a Cell information in another Workbook | Excel Worksheet Functions | |||
Finding all AutoShapes in workbook | Excel Programming | |||
Finding specific sheets within a workbook | Excel Discussion (Misc queries) | |||
Finding data in another workbook | Excel Programming | |||
Finding duplicate value in another workbook | Excel Programming |