LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default Searching in Excel

I am trying to design a module where the user would insert a number in the
search box and when the user presses the search button it would populate the
respective text boxes. The textboxes are on a UserForm. In the following
code when running I get the following error "Object variable or with block
variable not set". Any help would be greatly appreciated and a big thank you.

Private Sub cmdSearch_Click()
Dim wrkSheet As Worksheet
Dim wrkRng As Range
Dim intRow As Integer

Set wrkSheet = Worksheets("DataFile")

With wrkSheet
Set wrkRng = wrkSheet.Columns(1).Find(txtLocSrch)
intRow = wrkRng.Row <=============== Error Line
wrkSheet.Cells(intRow, 1) = txtLocation
wrkSheet.Cells(intRow, 2) = txtHost
wrkSheet.Cells(intRow, 3) = txtDistrict
wrkSheet.Cells(intRow, 4) = txtRespClass
End With
Set wrkSheet = Nothing

--
Larry E. Brueshaber
 
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
Searching, matching then searching another list based on the match A.S. Excel Discussion (Misc queries) 1 December 13th 06 05:08 AM
excel searching Curt Excel Worksheet Functions 2 September 28th 06 07:22 AM
Searching Excel for a value Spottie Excel Worksheet Functions 1 August 25th 05 03:25 AM
Searching within excel soregan Excel Programming 1 July 12th 04 01:03 PM
Searching in excel confused1111[_3_] Excel Programming 1 April 30th 04 10:32 PM


All times are GMT +1. The time now is 06:36 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"