Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
jet jet is offline
external usenet poster
 
Posts: 1
Default Finding a value from another workbook


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
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
Finding a Workbook based on a Cell information in another Workbook Walter Excel Worksheet Functions 1 October 10th 09 08:46 AM
Finding all AutoShapes in workbook ExcelMonkey Excel Programming 2 August 26th 05 05:25 PM
Finding specific sheets within a workbook Roy Excel Discussion (Misc queries) 2 August 23rd 05 06:40 PM
Finding data in another workbook JCanyoneer Excel Programming 4 August 17th 05 07:25 PM
Finding duplicate value in another workbook morry[_3_] Excel Programming 4 February 11th 04 10:27 PM


All times are GMT +1. The time now is 01:17 AM.

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"