Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default referring to a row that contains a single cell

I would like to write VBA code to hide an entire row which contains a single
cell named "MyCell." That is, I don't know which row MyCell" will be in,
but whatever row it's in, that's the row I want to hide.

The sheet will always be the ActiveSheet. How can I write a line of code
that will hide the row that "MyCell" is in?

Thanks in advance,

Paul


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default referring to a row that contains a single cell

Cells.Select
Selection.Find(What:="hat", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Select
Selection.EntireRow.Hidden = True



"Paul" wrote:

I would like to write VBA code to hide an entire row which contains a single
cell named "MyCell." That is, I don't know which row MyCell" will be in,
but whatever row it's in, that's the row I want to hide.

The sheet will always be the ActiveSheet. How can I write a line of code
that will hide the row that "MyCell" is in?

Thanks in advance,

Paul



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default referring to a row that contains a single cell

One of us mis-interpreted the question. If you are right, this is a bit
simpler if the word is in the cell by itself.

Sub HiderowifWHOLEtext()
cells.Find(What:="mycell", LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False) _
.EntireRow.Hidden = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"dmoney" wrote in message
...
Cells.Select
Selection.Find(What:="hat", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Select
Selection.EntireRow.Hidden = True



"Paul" wrote:

I would like to write VBA code to hide an entire row which contains a
single
cell named "MyCell." That is, I don't know which row MyCell" will be in,
but whatever row it's in, that's the row I want to hide.

The sheet will always be the ActiveSheet. How can I write a line of code
that will hide the row that "MyCell" is in?

Thanks in advance,

Paul




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default referring to a row that contains a single cell

Don, dmoney,

Don had it right the first time - the cell in question has the Range name of
"MyCell." I tested the suggested solution,
"Range("MyCell").EntireRow.Hidden = True" and it works just fine.

Thanks so much for responding to my question, and for providing a solultion.

Paul




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
Referring a cell Terry0928 via OfficeKB.com Excel Discussion (Misc queries) 3 May 21st 10 09:22 AM
Question regarding referring to different cell Value Gunti Excel Discussion (Misc queries) 6 January 27th 09 12:00 AM
From single cell variables to a single column serie noyau New Users to Excel 1 December 22nd 06 06:43 AM
Referring to a cell(Newbie) San[_2_] Excel Programming 6 August 29th 06 08:08 AM
Referring to a cell in another sheet Mike D. Excel Programming 2 April 5th 05 02:49 AM


All times are GMT +1. The time now is 07:10 PM.

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

About Us

"It's about Microsoft Excel"