title: How do I create an interactive Sheet Manager?
body: <p>This is a tricky one for me, and I am desperately looking for help.</p>
  <p>I don't have much experience with coding or VBA everything I've done below was from googling and trying different things before it worked. Hence, the code is a total mess and it only does a fraction of what I need it to do..</p>
  <p>To explain things, I have a main sheet that needs to display and be used to create/delete sheets.
  I have a sheet where I have prices for glass, aluminium and other materials, and different Template sheets for Windows/Doors/Roofs, that all pull the prices from Reference sheet.</p>
  <p>What I did below is try to create a code so that when I type the number of windows I need in the main sheet, I'll get that many copies of the Window template sheet. Then I have a few formula that sums all sheets up and gives me a total price. This way, I can go back to each sheet and edit the window configuration.</p>
  <pre><code>Private Sub Worksheet_Change(ByVal target As Excel.Range)
      If target.Cells.Count = 0 Then Exit Sub
      If IsNumeric(target) And target.Address = &quot;$B$4&quot; Then
          Select Case target.Value
              Case 1 To 15: copierW
              Case Is &gt; 15: copierW
              End Select
              End If
  End Sub
  
  
  Sub copierW()
  Dim sh1 As Worksheet, sh2 As Worksheet, x As Integer
  Set sh1 = Sheets(&quot;Sheet1&quot;)
  Set sh2 = Sheets(&quot;W&quot;)
  x = ActiveSheet.Range(&quot;b4&quot;)
  
  For numtimes = 1 To x
      ActiveWorkbook.Sheets(&quot;W&quot;).Copy _
      After:=ActiveWorkbook.Sheets(&quot;Sheet1&quot;)
  Next
  Worksheets(1).Select
  End Sub
  </code></pre>
  <p>Now the issue I have, is, let's say, I initially type in &quot;8&quot; as number of windows needed, it will create 8 copies. But if I change my mind and want only 6, and type in 6, it will create an additional 6 copies.</p>
  <p>I'm looking for a way for the code to understand it needs to keep the 1-6 sheets with all the information already in it, but delete the excess only. I wanted to try deleting all Sheets names Window (6+) based on the name, but it would still execute the copy function first.</p>
  <p>I am so confused as to where to even start or how to search for what I need.</p>
  <p>There's other things that I need to do, like the main sheet displaying a certain cell from each sheet, but stack them under each-other. So A2 in Window1(sheet) would be displayed in Main sheet - C4, but A2 in Window2(sheet) would be displayed in Main Sheet - C5, etc.</p>
  <p>Please let me know if you need more information or anything else I can do.</p>