Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DJH DJH is offline
external usenet poster
 
Posts: 14
Default 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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default 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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select cells according to row number in different sheet Helenf Excel Discussion (Misc queries) 3 May 21st 09 09:44 PM
Up down arrow keys do not select cells if select locked cells unch roandrob Excel Discussion (Misc queries) 3 May 18th 09 12:48 AM
Still can select locked cells in protected sheet Andy New Users to Excel 11 October 29th 05 07:45 PM
is it possible to select and change the values of cells in a minimized excel spread sheet from vba? Daniel Excel Worksheet Functions 6 July 11th 05 11:24 PM
how can i select all the cells with same color on a sheet if there are multipale colors by vba code uobt Charts and Charting in Excel 1 December 15th 04 05:27 PM


All times are GMT +1. The time now is 12:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"