![]() | ![]() | ![]() |
| |||||||
| Forums | Register | Groups | Awards | Arcade | Pets | T-Bucks / T-Store | Invite Your Friends | Blogs | Mark Forums Read |
| Web Design Forums and discussions on webdesign |
Web Design | |||||||||
|
|
|
|
| |||||
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| Enlisted Warrior ![]() | I have absolutly no experience with VB but have copied various scripts from different sources to try to create a page that will copy itself from a button on another page in the workbook and remove the formulas and hyper links. The script below works fine, but I want to re-insert the formulas I had in column L22:L25 (either that or not remove them to begin with) at the time of the copy. I have Hyper links to other information on the sheet that I need to remove so I can send the sheet by e-mail. Any Ideas? Option Explicit Sub createpo() Dim NewName As String Dim nm As Name Dim ws As Worksheet With Application .ScreenUpdating = False ' Copy specific sheets ' *SET THE SHEET NAMES TO COPY BELOW* ' Array("Blank P.O")) ' Sheet names go inside quotes, seperated by commas On Error GoTo ErrCatcher Sheets(Array("Blank P.O")).Copy On Error GoTo 0 ' Paste sheets as values ' Remove External Links, Hperlinks and hard-code formulas ' Make sure A1 is selected on all sheets For Each ws In ActiveWorkbook.Worksheets ws.Cells.Copy ws.[A1].PasteSpecial Paste:=xlValues ws.Cells.Hyperlinks.Delete Application.CutCopyMode = False Cells(1, 1).Select ws.Activate Next ws Cells(1, 1).Select ' Remove named ranges For Each nm In ActiveWorkbook.Names nm.Delete Next nm ' delete column N thru R Columns("N:R").Select Selection.Delete Shift:=xlToLeft .ScreenUpdating = True End With Exit Sub ErrCatcher: MsgBox "Specified sheets do not exist within this workbook" End Sub |
| | |
![]() |
| Bookmarks |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Adding Formulas to | cevaughn | Help & Suggestions Center | 1 | 10-04-2008 00:13 |
| adding data to sheet 2 from sheet 1 | jegal76 | Microsoft Applications | 4 | 10-29-2005 14:03 |
| Formatting text/formulas in sheet | Utkarsh | Microsoft Applications | 3 | 05-12-2005 20:00 |
| Help! Keep formulas from updating refs when copied?? | Ed | Microsoft Applications | 7 | 02-23-2005 16:00 |
| Adding hours and minutes in formulas | Trish | Microsoft Applications | 3 | 06-16-2004 01:52 |
![]() | ![]() | ![]() |