Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have set up a program to keep track of Registrations fo a Lions
Convention using a Userform to collect the data (LName; 1stname; etc). Everything works well and I can perform all functions required. The Data will fill approx 1500 - 1600 lines starting from Row A1 to the end of the data. The data is always expanding on a daily basis until max registrations are received. I have a requirement to occassionaly select a specific record to make any changes that might be required after the fact. I have copied the following code from a book "Visual Basic in easy Steps" by Tim Anderson. The code is as follows: Private Sub cbSearch() Dim Searchvar As String Dim sBookmark As String Sheets(1).Activate ' Select Registration Sheet Searchvar = InputBox("enter the Lastname to find") Searchvar = Trim$(Searchvar) ' removes surplus spaces If Searchvar < "" Then ' Cancel if nothing entered With Sheet1.Recordset .findfirst "Lastname like '" + Searchvar + "*'" If .NoMatch Then ' RECORD NOT FOUND MsgBox "No matching Record" .bookmark = sBookmark End If End With Eendif End Sub The compiler see,s to balk at "With Sheet1.Recordset" and points to Recordset. I have not done a huge amount of programing and this has me stumped. Is the something I have done wrong or is there a easier way to accomplish what I want to do Dooley |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try substituting "UsedRange" for "Recordset" and see if it still balks.
Recordset normally applies to Pivot Tables or Query Tables. "Dooley007" wrote: I have set up a program to keep track of Registrations fo a Lions Convention using a Userform to collect the data (LName; 1stname; etc). Everything works well and I can perform all functions required. The Data will fill approx 1500 - 1600 lines starting from Row A1 to the end of the data. The data is always expanding on a daily basis until max registrations are received. I have a requirement to occassionaly select a specific record to make any changes that might be required after the fact. I have copied the following code from a book "Visual Basic in easy Steps" by Tim Anderson. The code is as follows: Private Sub cbSearch() Dim Searchvar As String Dim sBookmark As String Sheets(1).Activate ' Select Registration Sheet Searchvar = InputBox("enter the Lastname to find") Searchvar = Trim$(Searchvar) ' removes surplus spaces If Searchvar < "" Then ' Cancel if nothing entered With Sheet1.Recordset .findfirst "Lastname like '" + Searchvar + "*'" If .NoMatch Then ' RECORD NOT FOUND MsgBox "No matching Record" .bookmark = sBookmark End If End With Eendif End Sub The compiler see,s to balk at "With Sheet1.Recordset" and points to Recordset. I have not done a huge amount of programing and this has me stumped. Is the something I have done wrong or is there a easier way to accomplish what I want to do Dooley |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Since usedrange doesn't have a FindFirst Method or NoMatch or BookMark
properties, it may be more complex than that. Perhaps you could eleborate. -- Regards, Tom Ogilvy "JLGWhiz" wrote in message ... Try substituting "UsedRange" for "Recordset" and see if it still balks. Recordset normally applies to Pivot Tables or Query Tables. "Dooley007" wrote: I have set up a program to keep track of Registrations fo a Lions Convention using a Userform to collect the data (LName; 1stname; etc). Everything works well and I can perform all functions required. The Data will fill approx 1500 - 1600 lines starting from Row A1 to the end of the data. The data is always expanding on a daily basis until max registrations are received. I have a requirement to occassionaly select a specific record to make any changes that might be required after the fact. I have copied the following code from a book "Visual Basic in easy Steps" by Tim Anderson. The code is as follows: Private Sub cbSearch() Dim Searchvar As String Dim sBookmark As String Sheets(1).Activate ' Select Registration Sheet Searchvar = InputBox("enter the Lastname to find") Searchvar = Trim$(Searchvar) ' removes surplus spaces If Searchvar < "" Then ' Cancel if nothing entered With Sheet1.Recordset .findfirst "Lastname like '" + Searchvar + "*'" If .NoMatch Then ' RECORD NOT FOUND MsgBox "No matching Record" .bookmark = sBookmark End If End With Eendif End Sub The compiler see,s to balk at "With Sheet1.Recordset" and points to Recordset. I have not done a huge amount of programing and this has me stumped. Is the something I have done wrong or is there a easier way to accomplish what I want to do Dooley |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to goto specific cell (todays date) | Excel Discussion (Misc queries) | |||
Goto a specific cell in a macro | Excel Discussion (Misc queries) | |||
Database Record add | Excel Discussion (Misc queries) | |||
Locate/goto a specific worksheet quickly | Excel Worksheet Functions | |||
Goto Specific Textbox in Userform | Excel Programming |