#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 74
Default No Cell Selected

Currently, if I open a spreadsheet, the file defaults to the last cell or
range selected prior to the last save. Is there a VBA command that deselects
any cell so when a file is opened, no cell is selected until the user clicks
on something?

Thanks,
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default No Cell Selected

Hi Brent

I don't think you can have a situation with no cell selected, but the
following code would put the cursor in cell A1 of Sheet1
Private Sub Workbook_Open()
ThisWorkbook.Sheets("Sheet1").Select
Range("A1").Activate
End Sub

Copy above code
Alt+F11 to invoke VB Editor
Control+F1 to open Project Explorer
Double click on ThisWorkbook
Paste code into white pane
Alt+F11 to return to Excel.

Save the workbook.
When it is opened next time cursor will be on sheet1 cell A1.
Change to suit

--
Regards
Roger Govier

"Brent E" wrote in message
...
Currently, if I open a spreadsheet, the file defaults to the last cell or
range selected prior to the last save. Is there a VBA command that
deselects
any cell so when a file is opened, no cell is selected until the user
clicks
on something?

Thanks,


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default No Cell Selected

Excel will always have a cell selected somewhere.

Which one is up to you and could be coded to open with a particular sheet
and cell selected.


Private Sub Workbook_Open()
Sheets("Sheet1").Select
Range("A1").Select
End Sub


Gord Dibben MS Excel MVP

On Fri, 17 Oct 2008 14:54:04 -0700, Brent E
wrote:

Currently, if I open a spreadsheet, the file defaults to the last cell or
range selected prior to the last save. Is there a VBA command that deselects
any cell so when a file is opened, no cell is selected until the user clicks
on something?

Thanks,


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,073
Default No Cell Selected

On Oct 18, 8:54*am, Brent E wrote:
Currently, if I open a spreadsheet, the file defaults to the last cell or
range selected prior to the last save. Is there a VBA command that deselects
any cell so when a file is opened, no cell is selected until the user clicks
on something?

Thanks,


If you save while a shape is selected then it reopens with the shape
still selected.
However ActiveCell.Address returns the address of the active cell
prior to selecting the shape.

Ken Johnson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,344
Default No Cell Selected

Hi,

I have to say this is not a standard request, so here is a non standard
solution.
1. Place an auto shape on a sheet
2. Reduce its size as much as possible.
3. Add code such as the following to the Workbook_Open event

Sheet(1).Activate
ActiveSheet.Shapes("Oval 9").Select

And don't anyone respond with how hokey this is, I know it is. But the
basic idea is you can select anything other than a cell and you aren't
selecting a cell!

--
Thanks,
Shane Devenshire


"Brent E" wrote:

Currently, if I open a spreadsheet, the file defaults to the last cell or
range selected prior to the last save. Is there a VBA command that deselects
any cell so when a file is opened, no cell is selected until the user clicks
on something?

Thanks,

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
copy selected part number of text from one cell into another cell orewa Excel Discussion (Misc queries) 1 April 11th 08 01:30 PM
How to change cell text based on another selected cell? jjh Excel Discussion (Misc queries) 1 July 6th 06 01:14 PM
how do I insert the address of a selected cell into a fixed cell cox Excel Discussion (Misc queries) 2 May 27th 06 07:44 PM
automatic offset cell location when there is a value in a selected cell. kuansheng Excel Worksheet Functions 0 February 23rd 06 01:40 AM
how read value from last selected cell? It is possible? how get adress last selected cell? Andrzej New Users to Excel 4 May 30th 05 07:28 PM


All times are GMT +1. The time now is 01:25 PM.

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

About Us

"It's about Microsoft Excel"