Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default find text in a cell and make cell 2 cells below that active

hello

my second post here, still learning VBA.
My question is pretty much included in the subject.
I need to find a cell in worksheet that contains text "descr1" - there is
only 1 cell like this in the worksheet - it is in a header, and make cell 2
cells below that active

any help is greatly appreciated

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default find text in a cell and make cell 2 cells below that active

Hi,

Try this:

Cells.Find(What:="descr1", After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Activate
Cells(ActiveCell.Row + 2, ActiveCell.Column).Select

Regards,
Stefi

€˛shark102€¯ ezt Ć*rta:

hello

my second post here, still learning VBA.
My question is pretty much included in the subject.
I need to find a cell in worksheet that contains text "descr1" - there is
only 1 cell like this in the worksheet - it is in a header, and make cell 2
cells below that active

any help is greatly appreciated

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default find text in a cell and make cell 2 cells below that active

Hi

Dim Sht as worksheet
Dim FoundCell as Range

'replace with your workbook and worksheet if required
Set Sht = Activeworkbook.Activeworksheet

With Sht
Set FoundCell = .Find("descr1", .Cells(1, 1), , , xlByColumns)
end with
If not FoundCell is Nothing then
Sht.Activate 'if not active already
FoundCell.offset(2,0).Activate
end if


Highlight Find in the editor and hit F1 key to look at its parameters
regards
Paul

shark102 wrote:
hello

my second post here, still learning VBA.
My question is pretty much included in the subject.
I need to find a cell in worksheet that contains text "descr1" - there is
only 1 cell like this in the worksheet - it is in a header, and make cell 2
cells below that active

any help is greatly appreciated


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default find text in a cell and make cell 2 cells below that active

ok Stefis method works, now I need to name this workshhet after value in
selected cell

sorry not to have written it in the first post :(

"Stefi" wrote:

Hi,

Try this:

Cells.Find(What:="descr1", After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Activate
Cells(ActiveCell.Row + 2, ActiveCell.Column).Select

Regards,
Stefi

€˛shark102€¯ ezt Ć*rta:

hello

my second post here, still learning VBA.
My question is pretty much included in the subject.
I need to find a cell in worksheet that contains text "descr1" - there is
only 1 cell like this in the worksheet - it is in a header, and make cell 2
cells below that active

any help is greatly appreciated

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default find text in a cell and make cell 2 cells below that active

I got it, no more help needed, thanks everybody for the effort.

"shark102" wrote:

ok Stefis method works, now I need to name this workshhet after value in
selected cell

sorry not to have written it in the first post :(

"Stefi" wrote:

Hi,

Try this:

Cells.Find(What:="descr1", After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Activate
Cells(ActiveCell.Row + 2, ActiveCell.Column).Select

Regards,
Stefi

€˛shark102€¯ ezt Ć*rta:

hello

my second post here, still learning VBA.
My question is pretty much included in the subject.
I need to find a cell in worksheet that contains text "descr1" - there is
only 1 cell like this in the worksheet - it is in a header, and make cell 2
cells below that active

any help is greatly appreciated

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro to find cell content in sheets and make sheet active Nigel Excel Discussion (Misc queries) 4 June 26th 14 02:38 PM
Find last cell in a column, Delete its contents and make it active George Excel Worksheet Functions 5 January 28th 10 05:38 PM
find specific text and make cell highlighted after the future Excel Discussion (Misc queries) 2 May 26th 06 02:11 PM
How to programmatically make a cell the Active Cell? Jack Excel Programming 3 May 13th 04 04:30 PM
Make a particular cell the active one Newbie Excel Programming 3 April 14th 04 04:52 PM


All times are GMT +1. The time now is 01:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"