![]() |
select all cells in sheet
What is the correct syntax to select all the cells in a sheet (so I can then
format the cells)? Manually, I would use shift-ctrl-end, selecting from A1 to the last cell. |
select all cells in sheet
With Cell A1 active
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select Regards Rowan "djh" wrote: What is the correct syntax to select all the cells in a sheet (so I can then format the cells)? Manually, I would use shift-ctrl-end, selecting from A1 to the last cell. |
select all cells in sheet
You don't usually need to select the cells to work with them.
with activesheet.usedrange.cells .numberformat = "General" end with (If row 1 isn't used and if column A isn't used, it won't be included.) With ActiveSheet With .Range("a1", .UsedRange) .NumberFormat = "general" End With End With Will get A1 to the bottom right corner. Or all the cells with activesheet.cells .numberformat = "General" end with djh wrote: What is the correct syntax to select all the cells in a sheet (so I can then format the cells)? Manually, I would use shift-ctrl-end, selecting from A1 to the last cell. -- Dave Peterson |
All times are GMT +1. The time now is 05:10 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com