find and scroll to cell string value in Excel

  • Thread starter Thread starter excel5336
  • Start date Start date
E

excel5336

I am trying to program a simple button in Excel to "jump" to a specific Title cell. However, because this worksheet will have rows added and deleted, moved about, this title cell must be programmed by the string (Title) within it, not the cell alpha+number.

Seems so simple, yet I cannot find the syntax for finding a cell by string and then going to that cell.

Thank you in advance for any help!
 
Hi,

Am Sat, 25 Jan 2014 02:18:13 -0800 (PST) schrieb (e-mail address removed):
I am trying to program a simple button in Excel to "jump" to a specific Title cell. However, because this worksheet will have rows added and deleted, moved about, this title cell must be programmed by the string (Title) within it, not the cell alpha+number.

Seems so simple, yet I cannot find the syntax for finding a cell by string and then going to that cell.

try:

Sub FindString()
Dim c As Range
Dim myStr As String

myStr = "Test"
With ActiveSheet
Set c = .UsedRange.Find(myStr, _
LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then Application.Goto c, 1
End With
End Sub


Regards
Claus B.
 
Hi,



Am Sat, 25 Jan 2014 02:18:13 -0800 (PST) schrieb (e-mail address removed):






try:



Sub FindString()

Dim c As Range

Dim myStr As String



myStr = "Test"

With ActiveSheet

Set c = .UsedRange.Find(myStr, _

LookIn:=xlValues, lookat:=xlWhole)

If Not c Is Nothing Then Application.Goto c, 1

End With

End Sub





Regards

Claus B.

--

Win XP PRof SP2 / Vista Ultimate SP2

Office 2003 SP2 /2007 Ultimate SP2

Wonderful! Thank you!
 
Back
Top