PDA

View Full Version : match multiline textbox item to coumn B3 in excel



mackypogi
06-11-2014, 07:37 PM
Hi All,

Im having trouble making a macro codes, here is the situation.

I have Useform1 & Textbox1 & Textbox2 & CommandButton1
*Textbox1 = Identifier where to put the "X" mark when data is found
*TextBox2 = The User Data 'It is a multiline textbox
*CommandButton1 = Execute the macro

*Excel Column "B3" = Where the textbox2 data will be compared. this one has default data.
*Excel Row 2 = the identifier where to put the "X" mark when the data is found.

The user will enter data in textbox2, For each TextBox2 Value it will be compared in the Data in Column B3 only If the Textbox1 Value found in Row2 which has the codes.
Then when the Value is found. it will mark with "X" in the column where the TextBox1 value found. Please see my screenshot.
Hi All,

Im having trouble making a macro codes, here is the situation.

I have Useform1 & Textbox1 & Textbox2 & CommandButton1
*Textbox1 = Identifier where to put the "X" mark when data is found
*TextBox2 = The User Data 'It is a multiline textbox
*CommandButton1 = Execute the macro

*Excel Column "B3" = Where the textbox2 data will be compared. this one has default data.
*Excel Row 2 = the identifier where to put the "X" mark when the data is found.

The user will enter data in textbox2, For each TextBox2 Value it will be compared in the Data in Column B3 only If the Textbox1 Value found in Row2 which has the codes.
Then when the Value is found. it will mark with "X" in the column where the TextBox1 value found. Please see my screenshot.

Form ScreenShot
11808

ExcelSheet ScreenSHot
11807

right now i only have this code.



Dim wSheet As Worksheet

'Counter
Dim x As Integer
Dim y As Integer

'Ranges
Dim RngDefault As Range 'Default Range
Dim RngData As Range
Dim ServiceRng As Range
Dim rng As Range

'Textbox
Dim aText As Variant
Dim i As Long



Sub CommandButton1_Click()

Set RngDefault = ActiveSheet.Range("B3" & ActiveSheet.Range("B3").End(xlDown).Address)
'Set rng = .Range(.Range("B3"), .Range("B" & rows.Count).End(xlUp))

For Each wSheet In Worksheets ' Loop Through all Worksheets


aText = Split(TextBox2.Value, vbCrLf) 'split value of textbox2


'x = 3

'For Each aText

'x = x + 1



Next wSheet

End Sub



' Clear all contents
Private Sub CommandButton2_Click()
TextBox1.Value = ""
TextBox2.Value = ""
End Sub

mackypogi
06-12-2014, 02:19 AM
Anyone can help me out?

snb
06-12-2014, 03:56 AM
I'm having troubles opening your sample workbook ....