What is the Simplest way to get range address of Text value in TextBox ?

NimishK

Well-known Member
Joined
Sep 4, 2015
Messages
684
Hello

What is the Simplest way to get Range Address of Particular Value in a Textbox
For Eg I Type Student in Textbox of userform and MSGbox to display Range Address ie C3:E9

StudentJohn
95​
StudentJimmy
91​
StudentJack
85​
StudentNelson
76​
StudentWoods
65​
StudentMichael
66​
StudentKaren
74​

What is the Simplest way to get range address of Text value in Userform textbox in a MsgBox ?​

sorry typo error in the Thread Topic

NimishK
 
Last edited:

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Try this:

VBA Code:
Private Sub CommandButton1_Click()
  Dim f As Range
  Set f = Range("C:C").Find(TextBox1.Value, , xlValues, xlWhole, , xlNext, False)
  If Not f Is Nothing Then MsgBox f.Resize(WorksheetFunction.CountIf(Range("C:C"), TextBox1.Value), 3).Address(0, 0)
End Sub
 
Upvote 0
Solution
Try this
VBA Code:
Private Sub CommandButton1_Click()
  Dim f As Range
  Set f = Range("C:C").Find(TextBox1.Value, , xlValues, xlWhole, , xlNext, False)
  If Not f Is Nothing Then MsgBox f.Resize(WorksheetFunction.CountIf(Range("C:C"), TextBox1.Value), 3).Address(0, 0)
End Sub
Just Perfect
Thanks a Tone DanteAmor :) ?

NimishK
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,843
Members
449,051
Latest member
excelquestion515

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