Consulting

Results 1 to 1 of 1

Thread: Update Row with Visible cells in Column

  1. #1

    Update Row with Visible cells in Column

    I have filtered list in column A
    I want to add the visible cell after filter to First Row of Sheet 1

    Ihave found a code to do this but its very long

    Public Sub NextValue()
    With Sheets("Detail").Range("A2:A50")
     Do
            ActiveCell.Offset(1).Select
            
        Loop While Rows(ActiveCell.Row).Hidden = True
        
        
        
     End With
    End Sub
    
    Public Sub UpdateRow()
    Sheets("Detail").Range("A1").Select
    
    
    NextValue
    Sheets("Sheet1").Range("A1") = ActiveCell
    
    NextValue
    Sheets("Sheet1").Range("B1") = ActiveCell
    
    NextValue
    Sheets("Sheet1").Range("C1") = ActiveCell
    
    NextValue
    Sheets("Sheet1").Range("D1") = ActiveCell
    
    End Sub
    If I want to add all filtered values then I have to add 49 lines of code

    "NextValue
    Sheets("Sheet1").Range("D1") = ActiveCell"

    since range A2:A50

    Can anyone simplify the code for me?
    Attached Files Attached Files

Posting Permissions

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