Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Cell to TextBox
I'm having an issue if anyone could help.
I'm very new to VB/VBA and I'm trying to Search a spreadsheet for specific text in column A, when it finds that data make the cell that data is in the Active cell , then move to column b the same row the data was on and select the text there, Then paste it to a textbox, then it would have to go to column d and do the same, How would i go about doing this? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Cell to TextBox
I'm not clear. What purpose would the text box serve?
In excel 2000, I don't usually paste information into a text box because it has a linked cell property. I don't know about later versions. Dan On Oct 22, 10:18 am, wrote: I'm having an issue if anyone could help. I'm very new to VB/VBA and I'm trying to Search a spreadsheet for specific text in column A, when it finds that data make the cell that data is in the Active cell , then move to column b the same row the data was on and select the text there, Then paste it to a textbox, then it would have to go to column d and do the same, How would i go about doing this? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Cell to TextBox
I'm using excel 2003, and I have a userform that needs to gather data, there are 10 different textboxes Some of them will have information on the sheet, i just dont know how to make it search find the cell, save what row its on then increment the columns, pull the data from the cells and put them into the textbox i was thinking maybe do a double loop where you set a high level loop to count through the rows, then the second loop inside that one that would count through the cells? But I'm not really sure how to do that :| On Oct 22, 12:45 pm, dan dungan wrote: I'm not clear. What purpose would the text box serve? In excel 2000, I don't usually paste information into a text box because it has a linked cell property. I don't know about later versions. Dan On Oct 22, 10:18 am, wrote: I'm having an issue if anyone could help. I'm very new to VB/VBA and I'm trying to Search a spreadsheet for specific text in column A, when it finds that data make the cell that data is in the Active cell , then move to column b the same row the data was on and select the text there, Then paste it to a textbox, then it would have to go to column d and do the same, How would i go about doing this?- Hide quoted text - - Show quoted text - |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Cell to TextBox
Here is one way to do it. I had to put a delay in to keep the sub from
closing before the value was posted. You might be able to play with it and get rid of the delay. The line feed Chr(10) shows up as a paragraph symbol in the text box, but it does put both values in it. Sub findnpaste() Dim myData As Range lastRow = Worksheets(1).Cells(Rows.Count, 1).End(xlUp).Row 'Get last row number Set myData = Worksheets(1).Range("A2:A" & lastRow).Find("Specific text", LookIn:=xlValues) If Not myData Is Nothing Then newData = myData.Offset(0, 1) & Chr(10) & myData.Offset(0, 3) Worksheets(1).TextBox1.Value = newData TenthSecDly End If End Sub Public Function TenthSecDly() s = Timer + 0.1 Do While Timer < s DoEvents Loop End Function " wrote: I'm using excel 2003, and I have a userform that needs to gather data, there are 10 different textboxes Some of them will have information on the sheet, i just dont know how to make it search find the cell, save what row its on then increment the columns, pull the data from the cells and put them into the textbox i was thinking maybe do a double loop where you set a high level loop to count through the rows, then the second loop inside that one that would count through the cells? But I'm not really sure how to do that :| On Oct 22, 12:45 pm, dan dungan wrote: I'm not clear. What purpose would the text box serve? In excel 2000, I don't usually paste information into a text box because it has a linked cell property. I don't know about later versions. Dan On Oct 22, 10:18 am, wrote: I'm having an issue if anyone could help. I'm very new to VB/VBA and I'm trying to Search a spreadsheet for specific text in column A, when it finds that data make the cell that data is in the Active cell , then move to column b the same row the data was on and select the text there, Then paste it to a textbox, then it would have to go to column d and do the same, How would i go about doing this?- Hide quoted text - - Show quoted text - |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Cell to TextBox
If you used a ListBox, you could use the AddItem method ot increment the
list. Unfortunately, the TextBox does not accomodate the add item method. I did think it would acknowledge a line feed, but apparently, the one from the control tool box doesn't do that either. Unless you intend to have the user type into or delete from the text box, I would give some serious consideration to using the ListBox. " wrote: I'm using excel 2003, and I have a userform that needs to gather data, there are 10 different textboxes Some of them will have information on the sheet, i just dont know how to make it search find the cell, save what row its on then increment the columns, pull the data from the cells and put them into the textbox i was thinking maybe do a double loop where you set a high level loop to count through the rows, then the second loop inside that one that would count through the cells? But I'm not really sure how to do that :| On Oct 22, 12:45 pm, dan dungan wrote: I'm not clear. What purpose would the text box serve? In excel 2000, I don't usually paste information into a text box because it has a linked cell property. I don't know about later versions. Dan On Oct 22, 10:18 am, wrote: I'm having an issue if anyone could help. I'm very new to VB/VBA and I'm trying to Search a spreadsheet for specific text in column A, when it finds that data make the cell that data is in the Active cell , then move to column b the same row the data was on and select the text there, Then paste it to a textbox, then it would have to go to column d and do the same, How would i go about doing this?- Hide quoted text - - Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA cell to textbox | Excel Discussion (Misc queries) | |||
HELP! I Lost The Ability To Advance From TextBox To TextBox With the ENTER Or The TAB Keys | Excel Programming | |||
Textbox Bug? Missing/delayed update of textbox filled via VBA | Excel Programming | |||
Textbox Bug? Missing/delayed update of textbox filled via VBA | Excel Programming | |||
get cell value to textbox | Excel Programming |