Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have created a custom user form to input data. Now I
need a macro that will search column A for example for the value which is input into text box 1, and furthermore, if the value entered in text box 1 is found, I need the cell values for that specific record to be displayed in the various text boxes on the user form for editting, like for example I have a user form: User Id, user name, user city 123, bob, kansas city I need to search for 123 and return all values (123, bob, kansas city) to text boxes on the user form so I can edit them and ultimately save the changes. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim rng as Range
with Worksheets("Sheet1").Columns(1) set rng = .find(what:=Userform1.Textbox1.Text, _ After:=Range(A65536), _ LookIn:=xlFormulas, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) End with If not rng is Nothing then With Userform1 .Textbox2.Text = rng.offset(0,1).Value .Textbox3.Text = rng.Offset(0,2).Value ' and so forth End with Else msgbox Userform1.Textbox1.Text & _ " was not found" End If -- Regards, Tom Ogilvy wrote in message ... I have created a custom user form to input data. Now I need a macro that will search column A for example for the value which is input into text box 1, and furthermore, if the value entered in text box 1 is found, I need the cell values for that specific record to be displayed in the various text boxes on the user form for editting, like for example I have a user form: User Id, user name, user city 123, bob, kansas city I need to search for 123 and return all values (123, bob, kansas city) to text boxes on the user form so I can edit them and ultimately save the changes. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you for the repsonse...I am getting the error 1004
Method 'Range' of object '_Global' failed -----Original Message----- Dim rng as Range with Worksheets("Sheet1").Columns(1) set rng = .find(what:=Userform1.Textbox1.Text, _ After:=Range(A65536), _ LookIn:=xlFormulas, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) End with If not rng is Nothing then With Userform1 .Textbox2.Text = rng.offset(0,1).Value .Textbox3.Text = rng.Offset(0,2).Value ' and so forth End with Else msgbox Userform1.Textbox1.Text & _ " was not found" End If -- Regards, Tom Ogilvy wrote in message ... I have created a custom user form to input data. Now I need a macro that will search column A for example for the value which is input into text box 1, and furthermore, if the value entered in text box 1 is found, I need the cell values for that specific record to be displayed in the various text boxes on the user form for editting, like for example I have a user form: User Id, user name, user city 123, bob, kansas city I need to search for 123 and return all values (123, bob, kansas city) to text boxes on the user form so I can edit them and ultimately save the changes. . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() see answer to your second posting on this topic. -- Regards, Tom Ogilvy wrote in message ... Thank you for the repsonse...I am getting the error 1004 Method 'Range' of object '_Global' failed -----Original Message----- Dim rng as Range with Worksheets("Sheet1").Columns(1) set rng = .find(what:=Userform1.Textbox1.Text, _ After:=Range(A65536), _ LookIn:=xlFormulas, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) End with If not rng is Nothing then With Userform1 .Textbox2.Text = rng.offset(0,1).Value .Textbox3.Text = rng.Offset(0,2).Value ' and so forth End with Else msgbox Userform1.Textbox1.Text & _ " was not found" End If -- Regards, Tom Ogilvy wrote in message ... I have created a custom user form to input data. Now I need a macro that will search column A for example for the value which is input into text box 1, and furthermore, if the value entered in text box 1 is found, I need the cell values for that specific record to be displayed in the various text boxes on the user form for editting, like for example I have a user form: User Id, user name, user city 123, bob, kansas city I need to search for 123 and return all values (123, bob, kansas city) to text boxes on the user form so I can edit them and ultimately save the changes. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to create 3D Button in C# | Links and Linking in Excel | |||
create button to find today's date in another tab | Excel Worksheet Functions | |||
How to create a new page with a button? | Excel Discussion (Misc queries) | |||
Create a button | Excel Discussion (Misc queries) | |||
create a clear button | Excel Discussion (Misc queries) |