![]() |
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 |
referring to a row that contains a single cell
Sub hidenamedcellrow()
Range("MyCell").EntireRow.Hidden = True End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Paul" wrote in message ... 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 |
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 |
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 |
referring to a row that contains a single cell
Glad to help
-- Don Guillett Microsoft MVP Excel SalesAid Software "Paul" wrote in message ... 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 |
All times are GMT +1. The time now is 04:05 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com