Sub select_visible()\n'\n' select_visible Macro\n'\n' Keyboard Shortcut: Ctrl+Shift+Q\n'\n Range(\"A1:D7\").Select\n Range(\"B5\").Activate\n Selection.SpecialCells(xlCellTypeVisible).Select\nEnd Sub\n<\/code><\/pre>\n\n\n\nRun the macro to select the desired range. The problem with this macro is that it works only for this specific example because the exact range is written into the code.<\/p>\n\n\n\n
What we want to do, is to select the current region (the region with an active cell).<\/p>\n\n\n\n
Let’s replace the two first lines on the procedure with the line selecting the current region. The full procedure looks like this:<\/p>\n\n\n\n
Sub select_visible()\n'\n' select_visible Macro\n'\n' Keyboard Shortcut: Ctrl+Shift+Q\n'\n ActiveCell.CurrentRegion.Select\n Selection.SpecialCells(xlCellTypeVisible).Select\nEnd Sub\n<\/code><\/pre>\n\n\n\nYou can also add this Macro as a shortcut to QAT.<\/p>\n\n\n\n
This time instead of selecting All Commands<\/strong>, select Macros<\/strong>.<\/p>\n\n\n\n <\/figure>\n\n\n\nMacros added to a toolbar have long and not the best-looking name, also the icon is the standard Macro icon.<\/p>\n\n\n\n <\/figure>\n\n\n\nWe can easily change that by clicking the Modify\u2026<\/strong> button. Here you can change the name and icon.<\/p>\n\n\n\n <\/figure>\n\n\n\nClick OK<\/strong> and the shortcut will appear on the Quick Access Toolbar<\/strong>.<\/p>\n\n\n\n <\/figure>\n\n\n\nClick a range of data with hidden rows or columns and notice that the whole region is selected with only visible data.<\/p>\n\n\n\n <\/figure>\n","protected":false},"excerpt":{"rendered":"When we work with an Excel spreadsheet, sometimes some columns are becoming too wide to fit on the screen or maybe there are…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[170,190],"yoast_head":"\n
Select Only the Visible Cells in Excel<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n