ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   going to a cell that contain specific data (https://www.excelbanter.com/excel-programming/369275-going-cell-contain-specific-data.html)

tom

going to a cell that contain specific data
 
Hi,

What i'm trying to do is setup a userform that lets the user select a name
then click on a button an goto that name on a sheet.

So far i have set up the userform and can select the name from a combo box
and have created a variable that holds what ever is selected in the combo
box

i.e. corp = ComboBox1.text

but i cant figure out how to take the user to the cell that contains the
same text.

i.e. if the user selects the name Bob i want to be able to take the user the
cell that contains Bob.

This wouldnt be problem if the cell that contains Bob was fixed, however it
is not fixed and moves.

Any ideas?

many thanks,

Bernie Deitrick

going to a cell that contain specific data
 
How this is implemented depends on what you do with your userform after the button is clicked....

Dim myR As Range

Set myR = Worksheets("Sheetname").Cells.Find(corp)

If Not myR Is Nothing Then
myR.Select
End If

HTH,
Bernie
MS Excel MVP


"Tom" wrote in message
...
Hi,

What i'm trying to do is setup a userform that lets the user select a name
then click on a button an goto that name on a sheet.

So far i have set up the userform and can select the name from a combo box
and have created a variable that holds what ever is selected in the combo
box

i.e. corp = ComboBox1.text

but i cant figure out how to take the user to the cell that contains the
same text.

i.e. if the user selects the name Bob i want to be able to take the user the
cell that contains Bob.

This wouldnt be problem if the cell that contains Bob was fixed, however it
is not fixed and moves.

Any ideas?

many thanks,




tom

going to a cell that contain specific data
 
Sorry for my late reply.

That worked a treat, i only needed to get it activate the sheet first.
Below is what i ended up with.

Dim myR As Range

Set myR = Worksheets("sheetname").Cells.Find(corp)

If Not myR Is Nothing Then
Sheet2.Activate
myR.Select
End If

Many thanks,
Tom

"Bernie Deitrick" wrote:

How this is implemented depends on what you do with your userform after the button is clicked....

Dim myR As Range

Set myR = Worksheets("Sheetname").Cells.Find(corp)

If Not myR Is Nothing Then
myR.Select
End If

HTH,
Bernie
MS Excel MVP


"Tom" wrote in message
...
Hi,

What i'm trying to do is setup a userform that lets the user select a name
then click on a button an goto that name on a sheet.

So far i have set up the userform and can select the name from a combo box
and have created a variable that holds what ever is selected in the combo
box

i.e. corp = ComboBox1.text

but i cant figure out how to take the user to the cell that contains the
same text.

i.e. if the user selects the name Bob i want to be able to take the user the
cell that contains Bob.

This wouldnt be problem if the cell that contains Bob was fixed, however it
is not fixed and moves.

Any ideas?

many thanks,





Bernie Deitrick

going to a cell that contain specific data
 
Tom,

That's precisely what I meant by "How this is implemented depends on what you do with your userform
after the button is clicked...."

Bernie
MS Excel MVP

That worked a treat, i only needed to get it activate the sheet first.





All times are GMT +1. The time now is 08:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com