Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-16-2015, 11:03 AM
Dextor Dextor is offline Enhanced search Windows XP Enhanced search Office 2010 32bit
Novice
Enhanced search
 
Join Date: Apr 2015
Posts: 1
Dextor is on a distinguished road
Default Enhanced search

I want to enhance Search Result and others (Instructions Available with Attached File)

It's available code which i am currently using.

Private Sub Close_cmd_Click()
Unload Me
End Sub
Private Sub Save_cmd_Click()
Dim ws2 As Worksheet
Dim lastRow As Long
Dim x As Long

Set ws2 = Sheets(3)
With ws2
lastRow = .Range("E:K").Cells.Find(What:="*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
.Range("E" & lastRow + 1).Value = Me.Text_AN.Value 'Applicant_Name'
.Range("F" & lastRow + 1).Value = Me.Text_FN.Value 'Father_Name'
.Range("G" & lastRow + 1).Value = Me.Text_CNIC.Value 'CNIC_No'
.Range("H" & lastRow + 1).Value = Me.Combo_RE.Value 'Address'
.Range("I" & lastRow + 1).Value = Me.Text_PN.Value 'Phone No'
.Range("J" & lastRow + 1).Value = Me.Combo_VP.Value 'Visit Purpose'
.Range("K" & lastRow + 1).Value = Me.Combo_RE.Value 'Rev_Estate'

lastRow = lastRow + 1

'For x = 0 To Me.lb_Region.ListCount - 1

' If Me.lb_Region.Selected(x) = True Then
' If .Range("E" & lastRow).Value = "" Then
' .Range("E" & lastRow).Value = Me.lb_Region.List(x)
' Else
' .Range("E" & lastRow).Value = .Range("E" & lastRow).Value & ", " & Me.lb_Region.List(x)
' End If
'End If






'Next x
End With
'Unload Me
End Sub
Private Sub Search_Cmd_Click()
Dim rng As Range
Dim strStates As String
Dim x As Long
If Me.Text_CNIC.Value = "" Then
MsgBox "Please enter a Name/ID to find!", vbExclamation
Me.Text_CNIC.SetFocus
Exit Sub
End If
With Sheets(4)
Set rng = .Range("G:G")
Set rng = rng.Find(What:=Me.Text_CNIC, After:=.Range("G1"), LookAt:=xlWhole)
If rng Is Nothing Then
MsgBox "Name/ID not found!", vbExclamation


Me.Text_CNIC.SetFocus
Exit Sub
End If
Me.Text_AN.Value = rng.Offset(0, 1).Value 'Applicant Name'
Me.Text_FN.Value = rng.Offset(0, 2).Value 'Father Name'
Me.Text_CNIC.Value = rng.Offset(0, 3).Value 'CNIC'
Me.Combo_RE.Value = rng.Offset(0, 4).Value 'Revenue Estate'
Me.Text_PN.Value = rng.Offset(0, 6).Value 'Phone No'
Me.Combo_VP.Value = rng.Offset(0, 7).Value 'Visit Purpose'

'strStates = rng.Offset(0, 1).Value



'For x = 0 To Me.lb_Region.ListCount - 1
' Me.lb_Region.Selected(x) = (InStr(strStates, Me.lb_Region.List(x)) > 0)
'Next x
End With
End Sub
Attached Files
File Type: xlsm Search-Updated.xlsm (53.9 KB, 11 views)

Last edited by Dextor; 04-17-2015 at 05:18 AM.
Reply With Quote
  #2  
Old 04-16-2015, 01:21 PM
Jhnsnkth527 Jhnsnkth527 is offline Enhanced search Windows 7 64bit Enhanced search Office 2010 64bit
Novice
 
Join Date: Apr 2015
Location: Cincinnati
Posts: 7
Jhnsnkth527 is on a distinguished road
Default

Can you describe the problem better? or add excerpts of the formula/code? I'm uncomfortable opening and enabling macro files.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Onenote 2013 search is not identifying search terms correctly Delta223 OneNote 0 08-12-2014 06:40 AM
Search for date and then apply mutliple search criteria in huge dataset maxtymo Excel 2 12-01-2013 04:52 AM
How do I insert an Enhanced Screentip? sunalta Word 1 04-07-2013 08:01 PM
Looking for Windows Search app with ability to search by content gopher_everett Office 1 02-28-2013 09:23 PM
Search and Replace - Clear Search box JostClan Word 1 05-04-2010 08:46 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:57 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft