Select specific number of rows (below the header row) based on value in another cell

  • I'd like to select a specific number of cells in Sheet3 based on the count available in cell Z1 in Sheet2. The below code is somewhat of help, but not completely. The data in Sheet3 is a filtered range and I'd like to select only the visible cells (based on the count provided in Z1) below the header column in Sheet 3. Thanks in advance!


    Code
    [COLOR=#303336]Sheets[/COLOR][COLOR=#303336]([/COLOR][COLOR=#7D2727]"Sheet3"[/COLOR][COLOR=#303336]).[/COLOR][COLOR=#303336]Range[/COLOR][COLOR=#303336]([/COLOR][COLOR=#7D2727]"A1:X"[/COLOR][COLOR=#303336]&[/COLOR][COLOR=#303336] Sheets[/COLOR][COLOR=#303336]([/COLOR][COLOR=#7D2727]"Sheet2"[/COLOR][COLOR=#303336]).[/COLOR][COLOR=#303336]Range[/COLOR][COLOR=#303336]([/COLOR][COLOR=#7D2727]"Z1"[/COLOR][COLOR=#303336]).[/COLOR][COLOR=#303336]Value[/COLOR][COLOR=#303336]).[/COLOR][COLOR=#101094]Select[/COLOR]
  • Try:

    Code
    Sheets("Sheet3").Range("A2:X" & Sheets("Sheet2").Range("Z1").Value).SpecialCells(xlCellTypeVisible).Select

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!