ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Userform idea (https://www.excelbanter.com/excel-programming/290205-userform-idea.html)

Robert Couchman

Userform idea
 
Hello,

yes you people will know my project inside and out soon!
i am looking for a way of creating a form that will allow
me to search through my files and when it finds the file i
am looking for it will open all the details in another
form.

i would also like to be able to edit this data if needed.

all the data for the people are on the same row,
each row is individual to the person.

any help, please let me know!

Thank you,

Robert Couchman

Bob Phillips[_6_]

Userform idea
 
Robert,

Here is a simple function to check file/directory existence that you should
be able to use

Public Function IfExists(FileName As String, Optional Directory As Boolean =
False) As Boolean
Dim sFile As String
If Directory Then
sFile = Dir(FileName, vbDirectory)
Else
sFile = Dir(FileName)
End If
IfExists = sFile < ""
End Function

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Robert Couchman" wrote in
message ...
Hello,

yes you people will know my project inside and out soon!
i am looking for a way of creating a form that will allow
me to search through my files and when it finds the file i
am looking for it will open all the details in another
form.

i would also like to be able to edit this data if needed.

all the data for the people are on the same row,
each row is individual to the person.

any help, please let me know!

Thank you,

Robert Couchman




Robert Couchman

Userform idea
 
Thank you for that point, but really i am looking for a
piece of script that will search through the 'records' in
my spreadsheet.

once it has found the row with the data on, it will then
display all the information related (along the row in
different columns) will be displayed in text boxes.

Hopefuly this is not impossible.

if anyone needs a more in depth explanation please just
say.

Thank you,

Robert Couchman

Bob Phillips[_6_]

Userform idea
 
That's funny, I've re-read the post and it definitely says '... that will
allow me to search through my files and when it finds the file i am looking
for ...'.

To look for data in a spreadsheet, let's assume the key is column A and you
want to find item "ABC".

Set oFind = Columns("A:A").Find("ABC")
If Find Is Nothing Then
MsgBox "Not found"
Else
Load Userform1
With Userform1
.Textbox1.Text = Ofind.Offset(0,1).Value ' the value in column B
for found item
.Textbox2.Text = Ofind.Offset(0,2).Value
'etc.
.Show
End With
End If

This is just rattled off, untested, but I hop it works and is what you want.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Robert Couchman" wrote in
message ...
Thank you for that point, but really i am looking for a
piece of script that will search through the 'records' in
my spreadsheet.

once it has found the row with the data on, it will then
display all the information related (along the row in
different columns) will be displayed in text boxes.

Hopefuly this is not impossible.

if anyone needs a more in depth explanation please just
say.

Thank you,

Robert Couchman




Robert Couchman[_3_]

Userform idea
 
Cheers,

that is great Bob,

i know the code may not work, but at least i now have
grounds to start the next major part of my program.

Thank you,

Robert Couchman


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com