ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Well, how hidden is it ?? (https://www.excelbanter.com/excel-programming/436231-well-how-hidden.html)

Gary''s Student

Well, how hidden is it ??
 
I have noticed that if I hide a row and then set a range across that hidden
row, the value gets applied to the €śhidden cell€ť:

Sub sub1()
Range("A2").EntireRow.Hidden = True
Range("A1:A3").Value = 1
Range("A2").EntireRow.Hidden = False
End Sub

The value gets applied to A2, even though the cell was hidden. If, however,
I hide the row using AutoFilter, the value in A2 does not get changed. It is
possible to apply this type of €śhiding€ť without using AutoFilter??

--
Gary''s Student - gsnu200908

Simon[_2_]

Well, how hidden is it ??
 
On Nov 16, 3:47*pm, Gary''s Student
wrote:
I have noticed that if I hide a row and then set a range across that hidden
row, the value gets applied to the “hidden cell”:

Sub sub1()
Range("A2").EntireRow.Hidden = True
Range("A1:A3").Value = 1
Range("A2").EntireRow.Hidden = False
End Sub

The value gets applied to A2, even though the cell was hidden. *If, however,
I hide the row using AutoFilter, the value in A2 does not get changed. *It is
possible to apply this type of “hiding” without using AutoFilter??

--
Gary''s Student - gsnu200908


Good question, i don't have an answer, but I suggest doing it via
autofilter then (in code) turn the autofilter off. Maybe that would
work?

Rick Rothstein

Well, how hidden is it ??
 
Try it this way...

Sub sub1()
Range("A2").EntireRow.Hidden = True
Range("A1:A3").SpecialCells(xlCellTypeVisible).Val ue = 1
Range("A2").EntireRow.Hidden = False
End Sub

--
Rick (MVP - Excel)


"Gary''s Student" wrote in message
...
I have noticed that if I hide a row and then set a range across that hidden
row, the value gets applied to the €śhidden cell€ť:

Sub sub1()
Range("A2").EntireRow.Hidden = True
Range("A1:A3").Value = 1
Range("A2").EntireRow.Hidden = False
End Sub

The value gets applied to A2, even though the cell was hidden. If,
however,
I hide the row using AutoFilter, the value in A2 does not get changed. It
is
possible to apply this type of €śhiding€ť without using AutoFilter??

--
Gary''s Student - gsnu200908



Gary''s Student

Well, how hidden is it ??
 
Thanks Rick, good suggestion.
--
Gary''s Student - gsnu200908


"Rick Rothstein" wrote:

Try it this way...

Sub sub1()
Range("A2").EntireRow.Hidden = True
Range("A1:A3").SpecialCells(xlCellTypeVisible).Val ue = 1
Range("A2").EntireRow.Hidden = False
End Sub

--
Rick (MVP - Excel)


"Gary''s Student" wrote in message
...
I have noticed that if I hide a row and then set a range across that hidden
row, the value gets applied to the €śhidden cell€ť:

Sub sub1()
Range("A2").EntireRow.Hidden = True
Range("A1:A3").Value = 1
Range("A2").EntireRow.Hidden = False
End Sub

The value gets applied to A2, even though the cell was hidden. If,
however,
I hide the row using AutoFilter, the value in A2 does not get changed. It
is
possible to apply this type of €śhiding€ť without using AutoFilter??

--
Gary''s Student - gsnu200908


.


Rick Rothstein

Well, how hidden is it ??
 
You are welcome. By the way, don't forget to put in some error trapping in
your general code just in case all the cells are hidden.

--
Rick (MVP - Excel)


"Gary''s Student" wrote in message
...
Thanks Rick, good suggestion.
--
Gary''s Student - gsnu200908


"Rick Rothstein" wrote:

Try it this way...

Sub sub1()
Range("A2").EntireRow.Hidden = True
Range("A1:A3").SpecialCells(xlCellTypeVisible).Val ue = 1
Range("A2").EntireRow.Hidden = False
End Sub

--
Rick (MVP - Excel)


"Gary''s Student" wrote in
message
...
I have noticed that if I hide a row and then set a range across that
hidden
row, the value gets applied to the €śhidden cell€ť:

Sub sub1()
Range("A2").EntireRow.Hidden = True
Range("A1:A3").Value = 1
Range("A2").EntireRow.Hidden = False
End Sub

The value gets applied to A2, even though the cell was hidden. If,
however,
I hide the row using AutoFilter, the value in A2 does not get changed.
It
is
possible to apply this type of €śhiding€ť without using AutoFilter??

--
Gary''s Student - gsnu200908


.




All times are GMT +1. The time now is 02:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com