ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Insert copied cells above hidden Named Range (https://www.excelbanter.com/excel-programming/442278-insert-copied-cells-above-hidden-named-range.html)

munchkin

Insert copied cells above hidden Named Range
 
I'm not sure what happened here - this worked in the past, but suddenly there
is a problem with "Selection.Insert Shift:=xlDown".

The "record end" named range is still there, so it's not that. The marco is
supposed to go to "RecordEnd" which is hidden, unhide it, insert the copied
cells while pushing "RecordEnd" below the inserted cells. It worked before -
anybody know what I'm doing wrong?

Sheets("DRIVER LIST").Select
Application.Goto Reference:="RecordEnd"
Selection.EntireRow.Hidden = True
Selection.Insert Shift:=xlDown
Application.Goto Reference:="RecordEnd"
Selection.EntireRow.Hidden = True
ActiveCell.Offset(-1).Activate

p45cal[_270_]

Insert copied cells above hidden Named Range
 

A complete shot in the dark; should the first instance of
Selection.EntireRow.Hidden = True
read:
Selection.EntireRow.Hidden = False
?


Munchkin;716131 Wrote:

I'm not sure what happened here - this worked in the past, but suddenly
there
is a problem with "Selection.Insert Shift:=xlDown".

The "record end" named range is still there, so it's not that. The

marco is
supposed to go to "RecordEnd" which is hidden, unhide it, insert the

copied
cells while pushing "RecordEnd" below the inserted cells. It worked

before -
anybody know what I'm doing wrong?

Sheets("DRIVER LIST").Select
Application.Goto Reference:="RecordEnd"
Selection.EntireRow.Hidden = True
Selection.Insert Shift:=xlDown
Application.Goto Reference:="RecordEnd"
Selection.EntireRow.Hidden = True
ActiveCell.Offset(-1).Activate



--
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile: http://www.thecodecage.com/forumz/member.php?u=558
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=200489

http://www.thecodecage.com/forumz


Don Guillett[_2_]

Insert copied cells above hidden Named Range
 
Try this. Tested from another sheet where f6 was copied to the the cell
above the hiddencell. NO selections.

Sub copybeforehiddenrow()
Range("f6").Copy
Range("hiddencell").Insert shift:=xlDown
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Munchkin" wrote in message
...
I'm not sure what happened here - this worked in the past, but suddenly
there
is a problem with "Selection.Insert Shift:=xlDown".

The "record end" named range is still there, so it's not that. The marco
is
supposed to go to "RecordEnd" which is hidden, unhide it, insert the
copied
cells while pushing "RecordEnd" below the inserted cells. It worked
before -
anybody know what I'm doing wrong?

Sheets("DRIVER LIST").Select
Application.Goto Reference:="RecordEnd"
Selection.EntireRow.Hidden = True
Selection.Insert Shift:=xlDown
Application.Goto Reference:="RecordEnd"
Selection.EntireRow.Hidden = True
ActiveCell.Offset(-1).Activate



FSt1

Insert copied cells above hidden Named Range
 
hi
the code you posted doesn't unhide the hidden range. it hides in again.
which is what i think is wrong. change the first
Selection.EntireRow.Hidden = True
to false ie
Selection.EntireRow.Hidden = False

then it should start doing what you expect.
i think.

regards
FSt1

"Munchkin" wrote:

I'm not sure what happened here - this worked in the past, but suddenly there
is a problem with "Selection.Insert Shift:=xlDown".

The "record end" named range is still there, so it's not that. The marco is
supposed to go to "RecordEnd" which is hidden, unhide it, insert the copied
cells while pushing "RecordEnd" below the inserted cells. It worked before -
anybody know what I'm doing wrong?

Sheets("DRIVER LIST").Select
Application.Goto Reference:="RecordEnd"
Selection.EntireRow.Hidden = True
Selection.Insert Shift:=xlDown
Application.Goto Reference:="RecordEnd"
Selection.EntireRow.Hidden = True
ActiveCell.Offset(-1).Activate



All times are GMT +1. The time now is 04:45 PM.

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