Results 1 to 12 of 12

Skipping hidden rows after filtering

Threaded View

  1. #1
    Registered User
    Join Date
    12-21-2020
    Location
    South Africa
    MS-Off Ver
    MS2016 & MS2019
    Posts
    41

    Skipping hidden rows after filtering

    Hi, I am busy with a custom calendar. I need to add code to this code so that it skips the hidden rows after filtering.

    Sub Months()
    '
    ' Months Macro
    '
    ' 
    
        Dim I As Long, j As Long, x As Long, lr As Long
        Dim sh1 As Worksheet, sh2 As Worksheet
    
        Set sh1 = Worksheets("Calendar")
        Set sh2 = Worksheets("Data")
        
    
        lr = sh2.Cells(Rows.Count, "U").End(xlUp).Row
        I = 14
        j = 4
    
        sh1.Cells(Rows.Count, 4).End(xlUp).EntireRow.Delete
    
        Application.ScreenUpdating = False
        
            Do While I < lr + 1
                For x = 2 To 8
                sh1.Cells(j, x).Value = sh2.Cells(I, 21).Value
                sh1.Cells(j + 1, x).Value = sh2.Cells(I, 10).Value
                sh1.Cells(j + 2, x).Value = sh2.Cells(I, 22).Value
                sh1.Cells(j + 3, x).Value = sh2.Cells(I, 5).Value
                I = I + 1
                Next x
            j = j + 4
            Loop
         
        
    'Application.ScreenUpdating = True
    
    
    End Sub
    Attached Files Attached Files
    Last edited by Rewmer; 02-27-2021 at 08:33 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Linking cells between sheets use the drag function but skipping hidden rows
    By truscotti in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-12-2020, 10:15 AM
  2. Hide Rows in most sheets skipping hidden sheets
    By NancyPez in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-11-2016, 04:53 PM
  3. Ignore hidden rows when filtering and de-selecting range issue
    By dgibney in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2014, 12:07 AM
  4. Replies: 4
    Last Post: 03-05-2014, 02:40 AM
  5. Replies: 3
    Last Post: 10-30-2013, 10:30 AM
  6. Hidden Rows being Overridden wihen Filtering & Copying
    By Pomrloo in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-11-2013, 04:06 PM
  7. Autofill Skipping Hidden Cells
    By birth19 in forum Excel General
    Replies: 4
    Last Post: 02-27-2012, 09:29 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1