C
Corey
A previous post got no replies, so i am still stuck on this:
I have 3 Columns in a Listbox.
I am needing to place the value into a Sheet for printing, but am not sure HOW to ONLY get the
Column 1 (Left) Value into the cell.
Currently i seem to get ALL 3 Column values.
I am using this code to input the values:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub CommandButton2_Click()
Application.ScreenUpdating = False
UserForm9.Hide
With ActiveWorkbook.Worksheets("JC")
..Select
Dim rngFound As Range
On Error Resume Next
With Worksheets("Data").Range("A:A")
Set rngFound = .Find(What:=UserForm9.ListBox4.Value, After:=.Cells(1), LookIn:=xlValues,
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, Matchbyte:=False)
Range("B2").Value = UserForm9.ListBox4.Value <== This has 3 Columns. But i want ONLY the Value in
Column1 to be placed in Cell B2
Range("D6").value = rngFound.Offset(0,4).value
....
.....
......
End Sub
Corey....
I have 3 Columns in a Listbox.
I am needing to place the value into a Sheet for printing, but am not sure HOW to ONLY get the
Column 1 (Left) Value into the cell.
Currently i seem to get ALL 3 Column values.
I am using this code to input the values:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub CommandButton2_Click()
Application.ScreenUpdating = False
UserForm9.Hide
With ActiveWorkbook.Worksheets("JC")
..Select
Dim rngFound As Range
On Error Resume Next
With Worksheets("Data").Range("A:A")
Set rngFound = .Find(What:=UserForm9.ListBox4.Value, After:=.Cells(1), LookIn:=xlValues,
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, Matchbyte:=False)
Range("B2").Value = UserForm9.ListBox4.Value <== This has 3 Columns. But i want ONLY the Value in
Column1 to be placed in Cell B2
Range("D6").value = rngFound.Offset(0,4).value
....
.....
......
End Sub
Corey....