Mar 18 2004, 06:48 AM
I'm sure I've seen this somewhere, but can someone remind me of the code to cycle through each sheet in the workbook in turn (I then want to overwrite all formulas with the values)
Any one assist?
Mar 18 2004, 07:05 AM
this shuid do it nicely for u
For Each w In Application.Worksheets '<- cant remember if this line is the correct one to use but it works
'eneter your paste special formula code here
Mar 18 2004, 07:43 AM
I believe this is what you want:
Dim ws As Worksheet
' you can hard-code the workbook if you like
For Each ws In ActiveWorkbook.Worksheets
ws.Range("A1") = 1
ws.Range("A2") = 1
ws.Range("A3").Formula = "=A1+A2"
Mar 18 2004, 08:07 AM
Thanks... it was the "For Each ... In... " context I was after.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here