Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default Loop in sheets

Sub RefreshCalculate()

Cells.Select
Selection.Replace What:="=", Replacement:="="
Application.MaxChange = 0.001
ActiveWorkbook.PrecisionAsDisplayed = False
Calculate
End Sub

What additional code (&where) do I need to add to make above macro run
on all sheets in workbook i.e loop in all sheets
Thxs

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Loop in sheets

This should do the trick.

Sub RefreshCalculate()
Dim MySheet as Worksheet

For Each MySheet In Worksheets
Cells.Select
Selection.Replace What:="=", Replacement:="="
Application.MaxChange = 0.001
ActiveWorkbook.PrecisionAsDisplayed = False
Calculate

Next

End Sub

Regards, Martijn

"al007" schreef in bericht
oups.com...
Sub RefreshCalculate()

Cells.Select
Selection.Replace What:="=", Replacement:="="
Application.MaxChange = 0.001
ActiveWorkbook.PrecisionAsDisplayed = False
Calculate
End Sub

What additional code (&where) do I need to add to make above macro run
on all sheets in workbook i.e loop in all sheets
Thxs



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Loop in sheets

Not quite

Sub RefreshCalculate()
Dim sh As Worksheet
ActiveWorkbook.PrecisionAsDisplayed = False
For Each sh In ActiveWorkbook.Worksheets
sh.Cells.Replace What:="=", Replacement:="="
Next sh
Application.MaxChange = 0.001
Calculate
End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"access" wrote in message
...
This should do the trick.

Sub RefreshCalculate()
Dim MySheet as Worksheet

For Each MySheet In Worksheets
Cells.Select
Selection.Replace What:="=", Replacement:="="
Application.MaxChange = 0.001
ActiveWorkbook.PrecisionAsDisplayed = False
Calculate

Next

End Sub

Regards, Martijn

"al007" schreef in bericht
oups.com...
Sub RefreshCalculate()

Cells.Select
Selection.Replace What:="=", Replacement:="="
Application.MaxChange = 0.001
ActiveWorkbook.PrecisionAsDisplayed = False
Calculate
End Sub

What additional code (&where) do I need to add to make above macro run
on all sheets in workbook i.e loop in all sheets
Thxs





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Loop in sheets

You still need to Select the sheet.

For Each MySheet In Worksheets
MySheet.Select
Cells.Select
Selection.Replace What:="=", Replacement:="="
Application.MaxChange = 0.001
ActiveWorkbook.PrecisionAsDisplayed = False
Calculate
Next


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"access" wrote in message
...
This should do the trick.

Sub RefreshCalculate()
Dim MySheet as Worksheet

For Each MySheet In Worksheets
Cells.Select
Selection.Replace What:="=", Replacement:="="
Application.MaxChange = 0.001
ActiveWorkbook.PrecisionAsDisplayed = False
Calculate

Next

End Sub

Regards, Martijn

"al007" schreef in bericht
oups.com...
Sub RefreshCalculate()

Cells.Select
Selection.Replace What:="=", Replacement:="="
Application.MaxChange = 0.001
ActiveWorkbook.PrecisionAsDisplayed = False
Calculate
End Sub

What additional code (&where) do I need to add to make above
macro run
on all sheets in workbook i.e loop in all sheets
Thxs





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default Loop in sheets

thxs all for ur help


Chip Pearson wrote:
You still need to Select the sheet.

For Each MySheet In Worksheets
MySheet.Select
Cells.Select
Selection.Replace What:="=", Replacement:="="
Application.MaxChange = 0.001
ActiveWorkbook.PrecisionAsDisplayed = False
Calculate
Next


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"access" wrote in message
...
This should do the trick.

Sub RefreshCalculate()
Dim MySheet as Worksheet

For Each MySheet In Worksheets
Cells.Select
Selection.Replace What:="=", Replacement:="="
Application.MaxChange = 0.001
ActiveWorkbook.PrecisionAsDisplayed = False
Calculate

Next

End Sub

Regards, Martijn

"al007" schreef in bericht
oups.com...
Sub RefreshCalculate()

Cells.Select
Selection.Replace What:="=", Replacement:="="
Application.MaxChange = 0.001
ActiveWorkbook.PrecisionAsDisplayed = False
Calculate
End Sub

What additional code (&where) do I need to add to make above
macro run
on all sheets in workbook i.e loop in all sheets
Thxs




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
Loop all Sheets not working. Pank New Users to Excel 12 February 27th 07 11:55 AM
Loop through all sheets in workbook jennie Excel Programming 7 October 26th 05 11:54 AM
Loop through sheets michael Excel Programming 2 September 8th 04 02:52 PM
excel VBA - for loop for several sheets paku Excel Programming 2 April 11th 04 12:33 AM
Loop across Sheets and number of sheets Raj[_8_] Excel Programming 2 December 18th 03 09:18 AM


All times are GMT +1. The time now is 07:25 AM.

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"