Return Active Cell value to Text Box

phisher12

New Member
Joined
Mar 29, 2014
Messages
24
Sorry new to VBA. I built a UserForm that filters coloumn's A, B, and C down to a single row based on the combobox selection(s). I want to pull the active cell value from Column D, E, and F (excluding the "header" or row 1) to a Text Box's in the User form. What is the best code that will ignore all the hidden values and only display the active row value not included row 1.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
If you are certain that the row is the active row then, for example for column D
Code:
Textbox1.Value = cells(Activecell.row,4).value
 
Upvote 0
If you are certain that the row is the active row then, for example for column D
Code:
Textbox1.Value = cells(Activecell.row,4).value

I guess my problem is finding the code to make the sorted value in column D,E, & F active. Once all three comboboxes are selected I will have only two rows visable (or active rows). Row 1 (which are just my headers) followed by the sorted row. It could be row 2 or row 244. Below is the code used on the comand click. Just need to figure out how to get the text box value to ignore the hidden cells between row 1 and the sorted result.


Code:
 Private Sub CommandButton1_Click()
 Application.ScreenUpdating = False
    With Sheets("Sheet1").UsedRange
        .AutoFilter
        If TradeCBO.ListIndex > -1 Then .AutoFilter 1, TradeCBO.Value
        
        If CustomerCBO.ListIndex > -1 Then .AutoFilter 2, CustomerCBO.Value
       
        If Statecbo.ListIndex > -1 Then .AutoFilter 3, Statecbo.Value
        '
     
    End With
    
    TextBox1 = Cells(Application.ActiveCell.Row + 1, 4).Value
   
    Application.ScreenUpdating = True
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,624
Latest member
gregg777

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top