A macro to paste values

G

Guest

In Excel we use a lot of formulas that link to our database and not everyone
who gets the excel sheets has the database. I want to write a macro that will
select every sheet in the workbook, select all cells and paste values. But
because the sheet names and the number of them are usually different i need
it to know to pick all the sheets availanle? Can anyone help with the
coding?!?
 
G

Guest

Sub noform()
For Each ws In Worksheets
ws.Select
Cells.Copy
Cells.PasteSpecial Paste:=xlPasteValues
Next
End Sub

will remove all formulas in the worksheets
 
B

Bob Phillips

For Each sh In Activeworkbook.Worksheets
sh.Range("A1").Copy 'as an example
'...
Next sh

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top