picklefactory
Well-known Member
- Joined
- Jan 28, 2005
- Messages
- 508
- Office Version
- 365
- Platform
- Windows
Hi folks
I found the below code on here (Thank you Steve the Fish) to copy a worksheet and rename..... works a treat, no problem there. However, I now wish to complicate matters (Like wot I always do). Currently it simply duplicates the sheet to a new sheet and renames as I wish from the value in a specified cell, but 3 of the cells contain a formula. Is it possible to have it copy the sheet but with cell values only, and not the formulae? It would be fine to have the entire sheet copied as values only, if that makes it easier, otherwise it's just cells C15, C17 and C19 that contain the formulae I don't want copied.
Is that tricky?
Here's the code
I found the below code on here (Thank you Steve the Fish) to copy a worksheet and rename..... works a treat, no problem there. However, I now wish to complicate matters (Like wot I always do). Currently it simply duplicates the sheet to a new sheet and renames as I wish from the value in a specified cell, but 3 of the cells contain a formula. Is it possible to have it copy the sheet but with cell values only, and not the formulae? It would be fine to have the entire sheet copied as values only, if that makes it easier, otherwise it's just cells C15, C17 and C19 that contain the formulae I don't want copied.
Is that tricky?
Here's the code
VBA Code:
'Copy sheet to new tab
Dim wks As Worksheet
Set wsTem = Sheets("Employee List")
Set wsMain = Sheets("Input")
If Not SheetExists(wsTem.Range("J9").Value) Then
wsMain.Copy after:=Worksheets(Sheets.Count)
ActiveSheet.Name = wsTem.Range("J9").Value
wsMain.Activate
End If