Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Best way to make all sheets in a workbook Values only

Hello All,

I've come across a couple of methods of making all sheets in a
workbook values only. The routines I have have a tentency towards
unexpected errors and they take a while to run e.g below. Has anyone
got an alternative method I could try.

Any help appreciated
Jason.

'========================
Private Function MakeSheetValuesOnly(mySheetName As String)

With ActiveWorkbook.Sheets(mySheetName)
With .Cells
.Copy
.PasteSpecial xlPasteValues
End With
.Select
.Range("A1").Select
End With
ActiveWindow.SmallScroll Down:=-200
Application.CutCopyMode = False

End Function 'MakeSheetValuesOnly
'=========================================
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Best way to make all sheets in a workbook Values only

Private Function MakeSheetValuesOnlyR1(mySheetName As String) as Byte
On Error GoTo LowValue
With ActiveWorkbook.Sheets(mySheetName).UsedRange
On Error Resume Next
.Value = .Value
If Err.Number < 0 Then
On Error GoTo LowValue
.Copy
.PasteSpecial xlPasteValues
Application.CutCopyMode = False
Else
On Error GoTo LowValue
End If
End With
ActiveWorkbook.Sheets(mySheetName).Select
ActiveWorkbook.Sheets(mySheetName).Range("A1").Sel ect
Exit Function
LowValue:
Beep
End Function
'---

Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(XL Companion add-in: compares, matches, counts, lists, finds, deletes...)




"WhytheQ"
wrote in message
...
Hello All,

I've come across a couple of methods of making all sheets in a
workbook values only. The routines I have have a tentency towards
unexpected errors and they take a while to run e.g below. Has anyone
got an alternative method I could try.

Any help appreciated
Jason.

'========================
Private Function MakeSheetValuesOnly(mySheetName As String)

With ActiveWorkbook.Sheets(mySheetName)
With .Cells
.Copy
.PasteSpecial xlPasteValues
End With
.Select
.Range("A1").Select
End With
ActiveWindow.SmallScroll Down:=-200
Application.CutCopyMode = False

End Function 'MakeSheetValuesOnly
'=========================================



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Best way to make all sheets in a workbook Values only

WhytheQ formulated the question :
Hello All,

I've come across a couple of methods of making all sheets in a
workbook values only. The routines I have have a tentency towards
unexpected errors and they take a while to run e.g below. Has anyone
got an alternative method I could try.

Any help appreciated
Jason.

'========================
Private Function MakeSheetValuesOnly(mySheetName As String)

With ActiveWorkbook.Sheets(mySheetName)
With .Cells
.Copy
.PasteSpecial xlPasteValues
End With
.Select
.Range("A1").Select
End With
ActiveWindow.SmallScroll Down:=-200
Application.CutCopyMode = False

End Function 'MakeSheetValuesOnly
'=========================================


Try...

Sub MakeSheetValuesOnly2()
Dim wks As Worksheet
For Each wks In ActiveWorkbook.Worksheets
With wks.UsedRange
.Value = .Value
End With 'wks.UsedRange
Next 'wks
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Best way to make all sheets in a workbook Values only

this looks nice Garry - happy to avoid the clipboard - I'll give it a
go

J



On Jul 1, 5:21*pm, GS wrote:
WhytheQ formulated the question :





Hello All,


I've come across a couple of methods of making all sheets in a
workbook values only. The routines I have have a tentency towards
unexpected errors and they take a while to run e.g below. Has anyone
got an alternative method I could try.


Any help appreciated
Jason.


'========================
Private Function MakeSheetValuesOnly(mySheetName As String)


With ActiveWorkbook.Sheets(mySheetName)
* * * * With .Cells
* * * * * * .Copy
* * * * * * .PasteSpecial xlPasteValues
* * * * End With
* * * * .Select
* * * * .Range("A1").Select
End With
ActiveWindow.SmallScroll Down:=-200
Application.CutCopyMode = False


End Function * * * * * * * 'MakeSheetValuesOnly
'=========================================


Try...

Sub MakeSheetValuesOnly2()
* Dim wks As Worksheet
* For Each wks In ActiveWorkbook.Worksheets
* * With wks.UsedRange
* * * .Value = .Value
* * End With 'wks.UsedRange
* Next 'wks
End Sub

--
Garry

Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Best way to make all sheets in a workbook Values only

On Jul 8, 5:54*am, WhytheQ wrote:
this looks nice Garry - happy to avoid the clipboard - I'll give it a
go

J

On Jul 1, 5:21*pm, GS wrote:



WhytheQ formulated the question :


Hello All,


I've come across a couple of methods of making all sheets in a
workbook values only. The routines I have have a tentency towards
unexpected errors and they take a while to run e.g below. Has anyone
got an alternative method I could try.


Any help appreciated
Jason.


'========================
Private Function MakeSheetValuesOnly(mySheetName As String)


With ActiveWorkbook.Sheets(mySheetName)
* * * * With .Cells
* * * * * * .Copy
* * * * * * .PasteSpecial xlPasteValues
* * * * End With
* * * * .Select
* * * * .Range("A1").Select
End With
ActiveWindow.SmallScroll Down:=-200
Application.CutCopyMode = False


End Function * * * * * * * 'MakeSheetValuesOnly
'=========================================


Try...


Sub MakeSheetValuesOnly2()
* Dim wks As Worksheet
* For Each wks In ActiveWorkbook.Worksheets
* * With wks.UsedRange
* * * .Value = .Value
* * End With 'wks.UsedRange
* Next 'wks
End Sub


--
Garry


Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc- Hide quoted text -


- Show quoted text -


Try:
Sub Formula_Zapper()
Worksheets.Select
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
ActiveSheet.Select
Application.CutCopyMode = False
End Sub
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
Make the same titles repeated in multiple sheets of a workbook Subodh Excel Programming 0 October 22nd 09 01:50 PM
copy/paste values for all sheets in workbook cass calculator Excel Programming 2 May 31st 07 11:36 PM
Comparing Cell values in two sheets within the same workbook [email protected] Excel Programming 10 February 16th 07 02:44 PM
How do I make changes in all sheets within a workbook? shfz Excel Worksheet Functions 1 August 4th 05 03:17 PM
Code to make sheets in a workbook visible Jonsson[_4_] Excel Programming 5 January 30th 04 12:38 PM


All times are GMT +1. The time now is 02:22 PM.

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"