Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

The find function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Albert - 31 Jan 2008 12:17 GMT
Hi Guys,

I got the following code

Sub message()
Dim Response As Integer
Dim destWB1 As Workbook

Response = MsgBox("Has the customer called in before?", vbQuestion +
vbYesNo, "")

If Response = vbYes Then
Set destWB1 = Workbooks.Open("K:\Customer services screen\Test Database\Test
DB.xlsm")
'destWB1.Sheets("Sheet1").Activate

       Dim myC As Range
       Set myC = Worksheets("Sheet1").Range("A:A").Find(TxtIDnumber.Text)
       If myC Is Nothing Then
       MsgBox frmCustomerService.TxtIDnumber.Text & " was not found."
       FrameContact.Visible = True
       TextNotesview.Visible = False
       LabelNotesview.Visible = False
       ActiveCell.Offset(0, 5) = "Called in before"
       DTPicker2.Value = CVar(Date)
'        frmCustomerService.DTPicker2.Value = CVar(Date)
       Else

       FrameContact.Visible = True
       frmCustomerService.TextBoxSpoketo.Text = myC(1, 3).Value 'Pick up
the cell to the right of the ID#
       frmCustomerService.DTPicker2.Value = myC(1, 2).Value 'Pick up the
cell two to the right of the ID#
       frmCustomerService.TextBoxOutcome.Text = myC(1, 10).Value
       frmCustomerService.TextNotesview.Text = myC(1, 12).Value

       End If

ElseIf Response = vbNo Then
'        myC(1, 6).Value = "No"
       ActiveCell.Offset(0, 5) = "No"
       FrameContact.Visible = False
       End If
destWB1.Close
End Sub

I can't get to find the textbox value eventhough I know it's in the workbook.

Please help?

Thanks
Albert
Joel - 31 Jan 2008 12:41 GMT
You may need lookin and lookat
Set myC = Worksheets("Sheet1").Range("A:A").Find( _
 what:=TxtIDnumber.Text, _
 lookin:=xlvalues, _
 lookat:=xlwhole)

> Hi Guys,
>
[quoted text clipped - 48 lines]
> Thanks
> Albert
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.