Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-15-2025, 04:49 AM
Logit Logit is online now Excel template Windows 10 Excel template Office 2007
Expert
 
Join Date: Jan 2017
Posts: 588
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default


Code:
Option Explicit

Sub MakeCopy()
Dim i As Integer
Application.CopyObjectsWithCells = False
    
For i = 1 To 2
    Sheets("Sample Sheet").Copy After:=Sheets(Sheets.Count)
    ActiveSheet.Name = "Sample Sheet" & Sheets.Count + 1
Next i
Application.CopyObjectsWithCells = True 'reset
End Sub
Reply With Quote
  #2  
Old 01-15-2025, 07:20 AM
Pablo2000 Pablo2000 is offline Excel template Windows 11 Excel template Office 2021
Advanced Beginner
Excel template
 
Join Date: Dec 2023
Posts: 62
Pablo2000 is on a distinguished road
Default

I click on the macro icon at the top with a red scroll. The create button is greyed out so I can not create another routeen. I right click on the icon and select new. Now I have another icon to the right of it. This should be availabel surly?

But, and I don't know how I managed it. I created another macro. Using my grey hairs on visual basic, I amended the routeen but I don't get exactly as I suspect. In my new code I get 11 tabs ranging from Test-3 through to Test-13, but I have said for I = 1 to 11, so it should be Test-1, Test-2.

Quote:
Dim i As Integer
Dim Name As String
Name = "Test-"
Application.CopyObjectsWithCells = False

For i = 1 To 11
Sheets("SH-1").Copy After:=Sheets(Sheets.Count)
ActiveSheet.Name = Name & Sheets.Count
Next i
Application.CopyObjectsWithCells = True 'reset
End Sub
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting data to an excel template Stevie23 Excel Programming 3 04-05-2018 12:12 AM
Excel template excel 2013 template jassie Excel 1 03-06-2017 10:36 AM
Excel Invoice Template DMU62 Excel 19 11-02-2016 12:17 PM
Excel template Excel Default Template kneghx Excel 1 05-13-2015 09:29 AM
Excel Chart Template mdarcey Excel 0 01-26-2012 08:43 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:28 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft