VBA - Look for range in another sheets

van0912

New Member
Joined
Jul 27, 2022
Messages
16
Office Version
  1. 2016
Platform
  1. Windows
Hello everyone,

I'm new in VBA and want to know how to look for results in another worksheet than the actual one. Actually, i have a textbox to research result but in the same sheet. Do you know how to do it?

Thank you for your help!

Private Sub TextBox1_Change()

Application.ScreenUpdating = False

Range("B46:B70").Interior.ColorIndex = 2
ListBox1.Clear

If TextBox1 <> "" Then

For ligne = 46 To 70
If Cells(ligne, 2) Like "*" & TextBox1 & "*" Then
Cells(ligne, 2).Interior.ColorIndex = 43

txt = Cells(ligne, 2)
ListBox1.AddItem txt

End If
Next

End If
End Sub
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
You would place the sheet name in front of the range
VBA Code:
sheets("Sheet2").Cells(ligne, 2)
 
Upvote 0
Solution

Forum statistics

Threads
1,215,444
Messages
6,124,891
Members
449,194
Latest member
JayEggleton

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