LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Ctrl + Home on all worksheets

I found the below code (compliments of Tom Ogilvy) that works great for what
I'm trying to do. I would just like one last step that I can't figure out.
I want to convert all formulas to values in all sheets, which is what the
code below does. When the code is done running, however, all the sheets are
still highlighted (selected). I would like to unselect all these ranges and
return to the active sheet. Basically, I would like the workbook to look
exactly the same after running the macro, minus the formulas. I'm sure this
is probably a very simple fix, but I'm brand new to vba and don't know it.

Sub convert_to_values()
'Removes ALL formulas and replaces them with valves,
'for each sheet in your workbook
Application.ScreenUpdating = False
Dim Sht As Worksheet
For Each Sht In ThisWorkbook.Worksheets
sht.Cells.copy
sht.Cells.PasteSpecial xlValues
Next Sht
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub



Thanks,

Jeff

 
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
HOW TO FORMAT THE HOME KEY WITHOUT USING CTRL Shelley Excel Discussion (Misc queries) 3 December 2nd 09 06:20 PM
Ctrl Home disabled in protected worksheets Rod from B.C. Government Excel Discussion (Misc queries) 5 April 28th 09 04:34 PM
Ctrl/Home changes the Zoom HuskerAlumna95 Excel Discussion (Misc queries) 4 March 4th 09 09:23 PM
Ctrl+Home is not A1 Lilbit Excel Worksheet Functions 2 September 25th 08 06:20 PM
Home or Ctrl-Home noyb Excel Programming 7 December 6th 05 07:42 PM


All times are GMT +1. The time now is 08:59 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"