• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

to Activate the Cell

Hi ,


I have an text as heading (RECAmount) in each file which might change its location , example in file A that heading is in Cell F16 and in file B it is in Cell G16.


Can i have a code which finds the Text in row 16 of all columns and also activate the cell in which the text is found.

thanks
 
Raghava


Firstly, Welcome to the Chandoo.org Forums

[pre]
Code:
Dim c As Range
With Rows(16)
Set c = .Find("RECAmount", LookIn:=xlValues)
If Not c Is Nothing Then c.Activate
End With
[/pre]
 
Hi Thanks for your quick response....


i also want to know incase if my text value is also changing then do i need set C for = "recamount" and SET C1 as = "DocValue" Set C2 as = "Doccurr"

Thanks
 
It is set for Row 16 Only ?

[pre]
Code:
Sub Test()

Dim c As Range
With Rows(16) 'Set your row No. here
Set c = .Find("RECAmount", LookIn:=xlValues)
If Not c Is Nothing Then
c.Activate
GoTo My_exit
End If

Set c = .Find("DocValue", LookIn:=xlValues)
If Not c Is Nothing Then
c.Activate
GoTo My_exit
End If

Set c = .Find("Doccurr", LookIn:=xlValues)
If Not c Is Nothing Then
c.Activate
GoTo My_exit
End If

End With
My_exit:

End Sub
[/pre]
 
Back
Top