unhide row and insert data

tintin1012000

Board Regular
Joined
Apr 27, 2011
Messages
237
Im using the below code to insert content of D4 into ''invoice'',

when this code has run I want to unhide all rows from A5 to A99 that have an entry in A

EG
Cells A5 to A10 have data, these cells needs to be un hidden, Cells A11 to A99 have now data and need to be hidden


HTML:
    Range("D4").Select
    Selection.Copy
    Sheets("INVOICE").Select
    Range("A" & Rows.Count).End(xlUp).Offset(1).Select
    ActiveSheet.Paste
    Sheets("STOCK OVERVIEW").Select
    Application.CutCopyMode = False
    Selection.ClearContents
    Range("G4").Select
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Try:
Code:
Sub Test()
    Application.ScreenUpdating = False
    Dim x As Integer
    For x = 99 To 5 Step -1
        If Cells(x, 1) <> "" Then
            Rows(x).EntireRow.Hidden = False
        Else:
            Rows(x).EntireRow.Hidden = True
        End If
    Next x
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,203,524
Messages
6,055,910
Members
444,832
Latest member
bgunnett8

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top