Hello everybody. I'm new to the forum and would appreciate some help. I have a code which allows me to copy sheet and rename based on cell value:
![]()
Private Sub CommandButton2_Click() Dim ws As Worksheet Set wh = Worksheets(ActiveSheet.Name) ActiveSheet.Copy After:=Worksheets(Sheets.Count) If wh.Range("C3").Value <> "" Then On Error Resume Next ActiveSheet.Name = wh.Range("C3").Value & ", " & wh.Range("C4").Value End If wh.Activate End Sub
I'd like for it to only copy a specific range of data from the sheet and paste only values and format (not formulas) into the newly created sheet.
In addition to that, if I'm trying to copy a sheet with the same name twice, I'm getting an error. Is there any possibility to add a number to the newly created sheet name in addition to the value/name (C3:C4 above) if there's already a sheet with the existing name?
Also, for some reason, the text within my ActiveX-buttons increases in size when I click on them. Any idea why that is and how to fix it?
Thanks in advance.
Bookmarks