It is only copying/selecting the visible cells. I want to copy the entire range, hidden and visible cells alike or select the entire range.
My worksheet has autofilter on and hidden columns & I have the following vba macro that inserts rows then copies the range "workpack" and pastes it into the newly inserted rows and a macro that deletes all values on the etc forecast line
However, if any filters are applied, when the macro is executed it doesn't behave as i want it to. Instead of copying the entire range like i want, it only copies the visible cells and pastes it in as values.
Please see the attached workbook. Execute the code by either clicking the button or hitting ctrl + shift + z. You will see what i mean. Set the filter so no filters are applied and then try running the macro again & it works properly as intended
Sub insertwp()
ActiveCell.Offset(6, 0).Rows("1:6").EntireRow.Select
Selection.Insert Shift:=xlDown
Range("workpack").Copy
ActiveCell.Select
ActiveSheet.Paste
ActiveCell.Select
ActiveCell = "Enter Lookup Here"
End Sub
Sub resetetc()
ActiveCell.Offset(4, 3).Range("A1:DL1").Select
Selection.ClearContents
ActiveCell.Offset(-4, -3).Range("A1").Select
End Sub
I tried
Range("Workpack").Entirerow.copy
but it still only copied visible cells
I am trying to avoid turning off autofilter as that triggers a recalc on my main sheet and the user has to reapply their filters and i am trying to avoid unhiding columns
So how can i get excel to copy/select the entire range or all cells in the defined range, hidden and visible.
is there some code similar to below that will do what I want
Range("Workpack").All.Copy/select
or
Range("Workpack").Entirerange.Copy/select
EDIT: MARKING THIS AS SOLVED
See this thread for solution to this problem: http://www.excelforum.com/excel-prog...09#post2802409
thanks
Bookmarks