title: How do I modify this vba to copy column width and conditional formatting to an active sheet?
body: <p>I am new to VBA.</p>
  <p>Thank you for your time. I have been Googling for 2 days and always get an error.</p>
  <p>I have two sheets</p>
  <ol>
  <li>Projects ( where I will store project names) and</li>
  <li>Template (where new projects will be created using the &quot;template&quot; sheet)</li>
  </ol>
  <p>I have 2 issues I am trying to solve :</p>
  <ol>
  <li><p>How do I copy the format on an active sheet including conditional formatting and column width. PasteSpecial already copies all the colour design but not the column width/conditional formatting</p>
  </li>
  <li><p>When I run the code it creates a new sheet called Project Name,not sure where that is coming from.</p>
  </li>
  </ol>
  <p>This is the code I am using:</p>
  <pre><code>Sub Copy()
  Sheets(&quot;Template&quot;).Range(&quot;A1:O100&quot;).Copy
  ActiveSheet.PasteSpecial
  End Sub
   
  </code></pre>
  <p>&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;</p>
  <p>I want to generate a project name, make sure it does not exist(no duplicate), open a new sheet and copy the template from &quot;template&quot;.</p>
  <p>The full codes is:</p>
  <pre><code>RunAll()
  CreateProjectName
  CreateNewTab
  CopyPaste
  End Sub
  </code></pre>
  <pre><code>Dim AddData As Range
  Dim AddName As String
  Set AddData = Cells(Rows.Count, 4).End(xlUp).Offset(1, 0)
  AddName = InputBox(&quot;Enter Project Name do not input manually&quot;, &quot;Project Monitor&quot;)
  If AddName = &quot;&quot; Then Exit Sub
  AddData.Value = AddName
  AddData.Offset(0, 1).Value = Now
  End Sub
  
  
  Function SheetCheck(sheet_name As String) As Boolean
  Dim ws As Worksheet
  SheetCheck = False
  For Each ws In ThisWorkbook.Worksheets
      If ws.Name = sheet_name Then
              SheetCheck = True
            End If
  Next
  End Function
  
  
  Sub CreateNewTab()
  Dim sheets_count As Integer
  Dim sheet_name As String
  Dim i As Integer
  sheet_count = Range(&quot;D3:D1000&quot;).Rows.Count
  For i = 1 To sheet_count
      sheet_name = Sheets(&quot;Projects&quot;).Range(&quot;D3:D1000&quot;).Cells(i, 1).Value
          If SheetCheck(sheet_name) = False And sheet_name &lt;&gt; &quot;&quot; Then
      Worksheets.Add(After:=Sheets(&quot;Projects&quot;)).Name = sheet_name
      End If
  
  Next i
  End Sub
  
  
  Sub CopyPaste()
  Sheets(&quot;Template&quot;).Range(&quot;A1:o100&quot;).Copy
    ActiveSheet.PasteSpecial
  End Sub
  
  </code></pre>