Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamHow do I copy hidden rows in Excel?
It depends on what you mean by “copy hidden rows” in Excel:
If you want to copy a range and include manually hidden rows:
Select the full range and press Ctrl+C, then paste. Excel normally includes manually hidden rows in a normal copy/paste.
If the rows are hidden by a filter:
Excel usually copies only the visible filtered rows. To copy the hidden filtered-out rows too, you need to clear the filter first, then copy the full range.
If you want to copy only the hidden rows and exclude visible rows:
Excel does not provide a simple built-in command for that. You can either unhide them and copy manually, invert the filter if filtering was used, or use VBA.
If rows were hidden using:
then a normal copy operation usually includes those hidden rows.
Steps:
A1:D100.The hidden rows will be pasted as part of the copied data. In the destination, they may appear visible unless the destination rows are also hidden.
If rows are hidden because you applied a filter, Excel treats the filtered-out rows differently.
For example, if you filter a table to show only “Completed” tasks, rows containing “Pending” are hidden by the filter. If you copy the visible filtered range, Excel normally copies only the visible rows.
To include the filtered-out hidden rows:
So, for filtered data, the safest method is: clear the filter first, then copy.
Many Excel users ask this question because they actually want to avoid copying hidden rows. If that is your goal, use Visible cells only.
Windows shortcut:
Alternative method:
This copies only what you can see and excludes manually hidden rows and columns.
Use this:
Select full range → Ctrl+C → Ctrl+V
But if the rows are hidden by a filter:
Clear filter → Select full range → Ctrl+C → Ctrl+V
Use this:
Select range → Alt+; → Ctrl+C → Ctrl+V
Excel has no simple native command for this. Options include:
Example VBA macro:
Sub CopyHiddenRows()
Dim rng As Range
Dim r As Range
Dim dest As Worksheet
Dim destRow As Long
Set rng = Selection
Set dest = Worksheets.Add
destRow = 1
For Each r In rng.Rows
If r.EntireRow.Hidden = True Then
r.Copy dest.Rows(destRow)
destRow = destRow + 1
End If
Next r
End Sub
To use it: