Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Find values in a closed excel workbook.

hey all,

GOt the below script working to search for people in a list. However i would
also like this to search throgh other excel sheets on a network drive which
are not opened at the moment. Is there a easy way of doing this. If anyone
does provide code please put it around what i have as i have dyslexia and
cannot see how it works sometimes.... Thanks in advance. Any input on how it
works would be greatly beneficial....


Dim AddrList(60000) As String
Dim n As Long, i As Long, c As Range, firstaddress As String
Dim Searchvalue As String

Searchvalue = UserForm1.TextBox_Employee.Value

n = 0
With Workbooks("database.xls").Worksheets("users").Rang e("g:g")
Set c = .Find(Searchvalue, LookIn:=xlValues)
If Not c Is Nothing Then
firstaddress = c.Address
Do
n = n + 1
AddrList(n) = c.Offset(, -5).Value
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstaddress
End If
End With

For i = 1 To n
UserForm2.ListBox1.AddItem AddrList(i)
Next i

UserForm2.Show
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Find values in a closed excel workbook.

JE McGimpsey shows how to get a value from a closed workbook he
http://www.mcgimpsey.com/macoffice/e...cellvalue.html
if you know exactly what cell has the value. Since you want to do a
search, I believe you will have to open the workbook.

Hth,
Merjet

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
Reading values from a closed workbook Graham F New Users to Excel 6 July 28th 08 03:32 PM
READING values from a closed workbook kev_06[_25_] Excel Programming 8 July 14th 06 10:30 PM
Get values from a closed workbook kev_06[_22_] Excel Programming 2 July 8th 06 11:38 AM
Getting Values From A Closed Workbook roshinpp_77[_2_] Excel Programming 3 May 30th 06 01:36 PM
find in closed workbook marko Excel Programming 0 November 25th 03 12:52 PM


All times are GMT +1. The time now is 08:13 PM.

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

About Us

"It's about Microsoft Excel"